/* Manufacturing home dashboard and the shared header tools. */

/* Header tools */
.uv-fy {
  margin-inline-start: 8px;
}
.uv-kairo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--uv-violet-ink) 25%, transparent);
  background: var(--uv-violet-bg);
  color: var(--uv-violet-ink);
  font: inherit;
  font-weight: 700;
  font-size: var(--uv-text-sm);
  cursor: pointer;
  transition: background var(--uv-fast) var(--uv-ease);
}
.uv-kairo .icon {
  width: 17px;
  height: 17px;
}
.uv-kairo:hover {
  background: var(--uv-violet-tile);
}
.topbar .uv-date-button {
  width: auto;
  gap: 6px;
  padding-inline: 8px;
}
.uv-date-text {
  font-size: var(--uv-text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.uv-calendar-popover .popover-content {
  width: 280px;
}
.uv-cal-today {
  margin: 0 0 10px;
  color: var(--uv-text-2);
  font-size: var(--uv-text-sm);
}
.uv-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: var(--uv-text-xs);
}
.uv-cal-grid b {
  color: var(--uv-text-2);
  font-weight: 600;
  padding-block: 4px;
}
.uv-cal-grid span {
  padding-block: 6px;
  border-radius: 8px;
  color: var(--uv-text);
}
.uv-cal-grid .today {
  background: var(--uv-brand);
  color: #172033;
  font-weight: 700;
}

/* Home layout */
.uv-home {
  display: grid;
  gap: 28px;
}
.uv-section {
  display: grid;
  gap: 14px;
}
.uv-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Welcome banner */
.uv-welcome {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 46%);
  align-items: center;
  min-height: 210px;
  border-radius: var(--uv-radius-xl);
  border: 1px solid var(--uv-border);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--uv-ill-sky) 0%, transparent 55%),
    linear-gradient(135deg, var(--uv-surface) 0%, var(--uv-bg) 100%);
  box-shadow: var(--uv-shadow-2);
  overflow: hidden;
}
[dir='rtl'] .uv-welcome {
  background:
    radial-gradient(120% 140% at 0% 0%, var(--uv-ill-sky) 0%, transparent 55%),
    linear-gradient(225deg, var(--uv-surface) 0%, var(--uv-bg) 100%);
}
.uv-welcome-copy {
  padding: 32px 36px;
  display: grid;
  gap: 8px;
}
.uv-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--uv-text-xs);
  font-weight: 700;
}
.uv-welcome h1 {
  margin: 0;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
  line-height: 1.2;
  color: var(--uv-text);
  letter-spacing: -0.01em;
}
.uv-welcome p {
  margin: 0;
  font-size: var(--uv-text-lg);
  color: var(--uv-text-2);
}
.uv-scene {
  width: 100%;
  height: 100%;
  max-height: 230px;
  align-self: end;
}
[dir='rtl'] .uv-scene {
  transform: scaleX(-1);
}
.uv-scene .s-glow {
  fill: var(--uv-ill-glow);
  opacity: 0.8;
}
.uv-scene .s-glow2 {
  fill: var(--uv-ill-far);
  opacity: 0.45;
}
.uv-scene .s-far {
  fill: var(--uv-ill-far);
}
.uv-scene .s-building {
  fill: var(--uv-ill-body);
}
.uv-scene .s-band {
  fill: var(--uv-ill-line);
}
.uv-scene .s-window {
  fill: var(--uv-ill-window);
}
.uv-scene .s-tank {
  fill: var(--uv-ill-tank);
}
.uv-scene .s-belt {
  fill: var(--uv-ill-belt);
}
.uv-scene .s-wheel {
  fill: var(--uv-ill-far);
}
.uv-scene .s-box {
  fill: var(--uv-ill-box);
}
.uv-scene .s-arm {
  fill: none;
  stroke: var(--uv-ill-line);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.uv-scene .s-arm circle {
  fill: var(--uv-ill-body);
  stroke: none;
}
.uv-scene .s-gear circle {
  fill: none;
  stroke: var(--uv-ill-tank);
  stroke-width: 6;
  stroke-dasharray: 5 4;
}
.uv-scene .s-gear circle:nth-child(2) {
  stroke-dasharray: none;
  stroke-width: 4;
}
.uv-scene .s-net path {
  fill: none;
  stroke: var(--uv-ill-line);
  stroke-width: 2;
  stroke-dasharray: 6 6;
  opacity: 0.7;
}
.uv-scene .s-net circle {
  fill: var(--uv-ill-line);
}

/* KPI cards */
.uv-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.uv-kpi {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 150px;
  padding: 18px;
  border-radius: var(--uv-radius-lg);
  border: 1px solid var(--uv-border);
  background: var(--uv-surface);
  box-shadow: var(--uv-shadow-1);
  color: var(--uv-text);
  font: inherit;
  text-align: start;
  transition:
    transform var(--uv-fast) var(--uv-ease),
    box-shadow var(--uv-fast) var(--uv-ease),
    border-color var(--uv-fast) var(--uv-ease);
}
button.uv-kpi {
  cursor: pointer;
}
button.uv-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--uv-shadow-2);
  border-color: color-mix(in srgb, var(--tone-ink) 30%, var(--uv-border));
}
.uv-kpi-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.uv-kpi-label {
  flex: 1;
  font-size: var(--uv-text-sm);
  font-weight: 600;
  color: var(--uv-text-2);
}
.uv-kpi-go {
  width: 16px;
  height: 16px;
  color: var(--uv-text-2);
  opacity: 0.6;
}
.uv-kpi-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--uv-text-2xl);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.uv-kpi-value small {
  font-size: var(--uv-text-sm);
  font-weight: 600;
  color: var(--uv-text-2);
}
.uv-kpi-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}
.uv-kpi-support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--uv-text-xs);
  color: var(--uv-text-2);
  line-height: 1.4;
}
.uv-trend-label {
  color: var(--uv-text-2);
}
.uv-spark {
  width: 92px;
  height: 32px;
  flex: none;
}
[dir='rtl'] .uv-spark {
  transform: scaleX(-1);
}
.uv-spark polyline {
  fill: none;
  stroke: var(--tone-ink);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.uv-spark polygon {
  fill: var(--tone-tile);
  opacity: 0.6;
}

/* Module cards */
.uv-modules {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
.uv-module {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 178px;
  padding: 22px;
  border-radius: var(--uv-radius-lg);
  border: 1px solid color-mix(in srgb, var(--tone-ink) 12%, transparent);
  background:
    radial-gradient(
      90% 80% at 100% 0%,
      color-mix(in srgb, var(--tone-tile) 70%, transparent),
      transparent 70%
    ),
    var(--tone-bg);
  color: var(--uv-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
  box-shadow: var(--uv-shadow-1);
  transition:
    transform var(--uv-fast) var(--uv-ease),
    box-shadow var(--uv-fast) var(--uv-ease);
}
[dir='rtl'] .uv-module {
  background:
    radial-gradient(
      90% 80% at 0% 0%,
      color-mix(in srgb, var(--tone-tile) 70%, transparent),
      transparent 70%
    ),
    var(--tone-bg);
}
.uv-module:hover {
  transform: translateY(-3px);
  box-shadow: var(--uv-shadow-3);
}
.uv-module:active {
  transform: translateY(-1px);
}
.uv-module-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--uv-surface);
  color: var(--tone-ink);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--tone-ink) 16%, transparent);
}
.uv-module-icon .icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.7;
}
.uv-module-copy {
  display: grid;
  gap: 6px;
}
.uv-module-copy strong {
  font-size: var(--uv-text-lg);
  font-weight: 700;
}
.uv-module-copy small {
  font-size: var(--uv-text-sm);
  color: var(--uv-text-2);
  line-height: 1.5;
}
.uv-module-arrow {
  position: absolute;
  inset-block-start: 20px;
  inset-inline-end: 20px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--uv-surface) 75%, transparent);
  color: var(--tone-ink);
  transition: transform var(--uv-fast) var(--uv-ease);
}
.uv-module-arrow .icon {
  width: 15px;
  height: 15px;
}
.uv-module:hover .uv-module-arrow {
  transform: translateX(3px);
}
[dir='rtl'] .uv-module:hover .uv-module-arrow {
  transform: translateX(-3px);
}

/* Platform banner */
.uv-brand-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 48%);
  align-items: center;
  gap: 12px;
  border-radius: var(--uv-radius-xl);
  background: linear-gradient(120deg, #172033 0%, #23304d 60%, #2d3a5a 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--uv-shadow-2);
}
.uv-brand-copy {
  padding: 28px 32px;
  display: grid;
  gap: 8px;
}
.uv-brand-copy .brand-copy strong {
  color: #fff;
}
.uv-brand-copy .brand-copy small {
  color: #c7d0e0;
}
.uv-brand-banner h2 {
  margin: 4px 0 0;
  font-size: var(--uv-text-xl);
  line-height: 1.3;
}
.uv-brand-banner p {
  margin: 0;
  color: #d5dcea;
  font-size: var(--uv-text-md);
}
.uv-brand-banner small {
  color: #ffb169;
  font-weight: 600;
  font-size: var(--uv-text-xs);
}
.uv-brand-banner .uv-scene {
  --uv-ill-body: #8b9cc0;
  --uv-ill-tank: #5b6a88;
  --uv-ill-belt: #ff7900;
  --uv-ill-window: #ffb169;
  max-height: 170px;
  padding-inline-end: 12px;
}

/* Quick actions */
.uv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.uv-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--uv-border);
  background: var(--uv-surface);
  color: var(--uv-text);
  font: inherit;
  font-weight: 600;
  font-size: var(--uv-text-sm);
  cursor: pointer;
  box-shadow: var(--uv-shadow-1);
  transition:
    border-color var(--uv-fast) var(--uv-ease),
    background var(--uv-fast) var(--uv-ease);
}
.uv-action .icon {
  width: 18px;
  height: 18px;
  color: var(--uv-brand-hover);
}
.uv-action:hover {
  border-color: color-mix(in srgb, var(--uv-brand) 45%, var(--uv-border));
  background: var(--accent-soft);
}

@media (max-width: 1280px) {
  .uv-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .uv-modules {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .uv-date-text,
  .uv-fy span {
    display: none;
  }
}
@media (max-width: 1024px) {
  .uv-modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .uv-kairo span {
    display: none;
  }
  .uv-fy {
    display: none;
  }
}
@media (max-width: 760px) {
  .uv-home {
    gap: 22px;
  }
  .uv-welcome,
  .uv-brand-banner {
    grid-template-columns: 1fr;
  }
  .uv-welcome .uv-scene {
    max-height: 150px;
  }
  .uv-welcome-copy {
    padding: 24px 22px 4px;
  }
  .uv-brand-copy {
    padding: 22px 22px 0;
  }
  .uv-kpis,
  .uv-modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .uv-module {
    min-height: 150px;
    padding: 16px;
    gap: 12px;
  }
  .uv-module-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .uv-action {
    flex: 1 1 calc(50% - 10px);
  }
}
@media (max-width: 420px) {
  .uv-kpis {
    grid-template-columns: 1fr;
  }
  .uv-module-copy small {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .uv-kpi,
  .uv-module,
  .uv-module-arrow {
    transition: none;
  }
  .uv-module:hover,
  button.uv-kpi:hover {
    transform: none;
  }
}

/* Breadcrumb (all internal pages) */
.uv-breadcrumb {
  margin-bottom: 14px;
}
/* Hide only static module crumbs; crumbs with links drive in-module navigation. */
#page-content:has(> .uv-breadcrumb) .page-heading .breadcrumb:not(:has(button, a)) {
  display: none;
}
.uv-home-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  margin-inline-start: 8px;
  border: 1px solid var(--uv-border);
  border-radius: 999px;
  background: var(--uv-surface);
  color: var(--uv-text);
  font: inherit;
  font-weight: 600;
  font-size: var(--uv-text-sm);
  white-space: nowrap;
  cursor: pointer;
}
.uv-home-button .icon {
  width: 16px;
  height: 16px;
  color: var(--uv-brand-hover);
}
.uv-home-button:hover {
  border-color: color-mix(in srgb, var(--uv-brand) 45%, var(--uv-border));
  background: var(--accent-soft);
}
@media (max-width: 1280px) {
  .uv-home-button span {
    display: none;
  }
  .uv-home-button {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
}
.uv-breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.uv-breadcrumb li {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}
.uv-breadcrumb li + li::before {
  content: '/';
  margin-inline: 6px;
  color: var(--uv-text-2);
  opacity: 0.6;
}
.uv-breadcrumb button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--uv-text-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.uv-breadcrumb button:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.uv-breadcrumb .icon {
  width: 16px;
  height: 16px;
}
.uv-breadcrumb [aria-current] {
  padding-inline: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--uv-text);
  font-weight: 700;
}

/* Section launcher */
.uv-launcher .popover-content {
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 620px);
  overflow: auto;
}
.uv-launch-search {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 10px;
  height: 40px;
  border: 1px solid var(--uv-border);
  border-radius: 10px;
  background: var(--uv-surface);
  color: var(--uv-text-2);
}
.uv-launch-search:focus-within {
  border-color: var(--uv-brand);
  box-shadow: var(--uv-focus);
}
.uv-launch-search .icon {
  width: 17px;
  height: 17px;
}
.uv-launch-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--uv-text);
  font: inherit;
}
.uv-launch-list,
.uv-launch-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.uv-launch-group + .uv-launch-group {
  border-top: 1px solid var(--uv-border);
}
.uv-launch-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--uv-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.uv-launch-list button:hover,
.uv-launch-list button:focus-visible {
  background: var(--accent-soft);
}
.uv-launch-section {
  font-weight: 700;
}
.uv-launch-section.active {
  color: var(--accent-ink);
}
.uv-launch-section .icon {
  width: 18px;
  height: 18px;
  color: var(--uv-brand-hover);
}
.uv-launch-list ul button {
  min-height: 32px;
  padding-inline-start: 38px;
  color: var(--uv-text-2);
  font-size: var(--uv-text-sm);
}
.uv-launch-empty {
  margin: 12px 4px;
  color: var(--uv-text-2);
}

/* Home: secondary sections */
.uv-more {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.uv-more-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--uv-border);
  background: var(--uv-surface);
  color: var(--uv-text);
  font: inherit;
  font-weight: 600;
  font-size: var(--uv-text-sm);
  cursor: pointer;
  transition: border-color var(--uv-fast) var(--uv-ease);
}
.uv-more-item .icon {
  width: 17px;
  height: 17px;
  color: var(--uv-text-2);
}
.uv-more-item:hover {
  border-color: color-mix(in srgb, var(--uv-brand) 45%, var(--uv-border));
}
