/*
 * mockup-v4 shell — customer-theme (frozen copy)
 * Standalone package — assets owned by mockup-v4.
 */

/*
 * Functional compatibility layer.
 * Customer CSS is merged verbatim in customer-source.css and remains the
 * presentation baseline. This file only connects the SPA behavior and pages
 * that were not included in the customer templates.
 */

:root {
  --background: var(--bg);
  --surface: var(--card);
  --surface-subtle: #fafbfc;
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --border: var(--line);
  --border-strong: #c9d0dc;
  --primary: var(--orange-500);
  --primary-dark: var(--orange-600);
  --secondary: var(--blue-500);
  --success: var(--green-600);
  --success-bg: var(--green-100);
  --warning: var(--amber-600);
  --warning-bg: var(--amber-100);
  --error: var(--red-600);
  --error-bg: var(--red-100);
  --info-bg: #e8f0fd;
  --nav: var(--navy-900);
  --nav-border: rgb(255 255 255 / 9%);
  --shadow: 0 8px 24px rgb(18 25 43 / 6%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081122;
  --card: #101d34;
  --line: #2a3b57;
  --ink-900: #f4f7fb;
  --ink-700: #d6deea;
  --ink-500: #aeb8cc;
  --ink-400: #8492a8;
  --green-600: #66d484;
  --green-500: #42bd67;
  --green-100: #123822;
  --amber-600: #ffc16b;
  --amber-500: #e8a03a;
  --amber-100: #3f2b14;
  --red-600: #ff8585;
  --red-500: #f05c67;
  --red-100: #421d28;
  --blue-500: #72a9f2;
  --purple-500: #a98af8;
  --background: var(--bg);
  --surface: var(--card);
  --surface-subtle: #14243f;
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --border: var(--line);
  --border-strong: #455873;
  --primary: #ff8a3d;
  --primary-dark: #ffad70;
  --secondary: var(--blue-500);
  --success: var(--green-600);
  --success-bg: var(--green-100);
  --warning: var(--amber-600);
  --warning-bg: var(--amber-100);
  --error: var(--red-600);
  --error-bg: var(--red-100);
  --info-bg: #17345a;
  --shadow: 0 12px 30px rgb(0 0 0 / 25%);
}

html,
body,
button,
input {
  font-family: "Inter", "Noto Sans Thai", system-ui, sans-serif;
}

body {
  overflow: hidden;
  background: var(--bg);
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(47 123 224 / 30%);
  outline-offset: 2px;
}

/* Login uses customer color/type/card primitives without inheriting app sidebar. */
.login-header .brand {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.login-header .brand-mark {
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
}

.login-header .brand-logo-login {
  display: block;
  height: 32px;
  width: auto;
  object-fit: contain;
}

.login-shell {
  background:
    radial-gradient(circle at 15% 12%, rgb(243 113 31 / 13%), transparent 30%),
    var(--bg);
}

.login-card,
.login-chip {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.login-card {
  border-top-color: var(--orange-500);
}

.login-chip:hover,
.login-chip.is-selected {
  border-color: var(--orange-500);
  background: var(--amber-100);
}

/* Shared app shell and exact customer sidebar surface. */
.app {
  height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}

.app[data-sidebar="closed"] {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  overflow: hidden;
}

.app[data-sidebar="closed"] .sidebar {
  visibility: hidden;
  pointer-events: none;
}

.sidebar .brand {
  position: relative;
  min-height: 64px;
}

.sidebar .brand-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sidebar .chev {
  position: static;
  margin-left: auto;
  display: grid;
  width: 24px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 8px;
  background: rgb(255 255 255 / 10%);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
}

.sidebar .brand-tag {
  padding-right: 18px;
  white-space: nowrap;
}

.profile-block {
  border-bottom: 1px solid var(--nav-border);
}

.profile-block .profile {
  border-bottom: 0;
}

.profile-block .avatar {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
}

.person-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: transparent;
}

.person-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.login-chip .person-avatar,
.operator-identity .person-avatar,
.operator-option .person-avatar,
.assignment-preview .person-avatar,
.replacement-option .person-avatar {
  border: 1px solid color-mix(in srgb, var(--orange-500) 24%, var(--line));
  box-shadow: 0 2px 8px rgb(10 23 48 / 10%);
}

.crew-chip .crew-avatar {
  width: 26px;
  height: 26px;
  grid-area: avatar;
  border: 1px solid rgb(255 255 255 / 70%);
}

.profile-role span {
  display: inline;
  color: inherit;
}

.profile-scope {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: 8px;
  margin: 0;
  padding: 0 18px 14px;
}

.profile-scope div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  background: rgb(255 255 255 / 3%);
}

.profile-scope dt {
  color: #9fa9be;
  font-size: 9px;
  font-weight: 700;
}

.profile-scope dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search {
  position: relative;
  margin: 10px;
}

.search label {
  display: block;
  margin: 0 3px 6px;
  color: #aeb8cc;
  font-size: 9px;
  font-weight: 700;
}

.search-box {
  display: grid;
  min-height: 40px;
  grid-template-columns: 20px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 8px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 10px;
  background: rgb(3 10 25 / 55%);
}

.search-box:focus-within {
  border-color: var(--orange-500);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 10px;
}

.search-box button {
  border: 0;
  background: transparent;
  color: #aeb8cc;
}

.search-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 250px;
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 10px;
  background: var(--navy-800);
  box-shadow: 0 16px 32px rgb(0 0 0 / 35%);
}

.search-results button,
.search-results p {
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid var(--nav-border);
  background: transparent;
  color: #fff;
  text-align: left;
}

.search-results small {
  display: block;
  margin-top: 3px;
  color: #aeb8cc;
}

.sidebar nav.nav {
  min-height: 0;
  padding: 6px 10px 12px;
}

.sidebar .nav-group {
  margin-bottom: 3px;
}

.sidebar .nav-group summary,
.sidebar .nav-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #cbd3e1;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  list-style: none;
  text-align: left;
}

.sidebar .nav-icon,
.sidebar .station-nav-icon {
  display: inline-grid;
  width: 28px;
  flex: 0 0 28px;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  color: inherit;
}

.sidebar .nav-svg {
  display: block;
  width: 24px;
  height: 24px;
}

.sidebar .station-nav-icon {
  width: 30px;
  flex-basis: 30px;
  font-size: 10px;
}

.sidebar .station-nav-img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 2px;
}

.station-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .nav-group summary::-webkit-details-marker {
  display: none;
}

.sidebar .nav-group summary::after {
  margin-left: auto;
  color: #7e8aa2;
  content: "+";
}

.sidebar .nav-group[open] summary::after {
  content: "−";
}

.sidebar .nav-group[open] summary {
  background: rgb(255 255 255 / 4%);
  color: #fff;
}

.sidebar .nav-group > .nav-item,
.sidebar .station-links .nav-item {
  width: calc(100% - 20px);
  margin-left: 20px;
  padding-left: 14px;
  border-left: 1px solid rgb(255 255 255 / 8%);
  border-radius: 0 8px 8px 0;
  color: #aeb8cc;
}

.sidebar .nav-item:hover,
.sidebar .nav-item:focus-visible {
  background: rgb(255 255 255 / 6%);
  color: #fff;
}

.sidebar .nav-item.is-active {
  border-left: 2px solid var(--orange-500);
  background: rgb(243 113 31 / 16%);
  color: #fff;
}

.sidebar .nav-dashboard {
  width: 100%;
  margin-left: 0;
  border-left: 0;
}

.sidebar .nav-item.is-muted {
  color: #68748c;
}

.sidebar .nav-item em {
  margin-left: auto;
  color: #7e8aa2;
  font-size: 8px;
  font-style: normal;
}

.sidebar .nav-item.is-enabled em,
.sidebar .nav-item.is-active em {
  color: var(--orange-400);
}

.admin-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.admin-action {
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  background: rgb(255 255 255 / 5%);
  color: #cbd3e1;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: auto;
  background: var(--bg);
}

.sidebar-reopen {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 14px;
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.app[data-sidebar="closed"] .sidebar-reopen {
  display: grid;
  place-items: center;
}

.view {
  display: none;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

.view.is-active {
  display: block;
}

.customer-legacy-page,
#view-station {
  padding: 22px 26px 40px;
}

#view-dashboard.is-active {
  display: block;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

#view-station .station-shell {
  display: block;
  height: auto;
  min-height: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.notice {
  position: fixed;
  z-index: 80;
  top: 20px;
  right: 24px;
  width: min(430px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid var(--amber-500);
  border-left: 4px solid var(--amber-500);
  border-radius: 10px;
  background: var(--amber-100);
  box-shadow: 0 14px 34px rgb(0 0 0 / 18%);
  color: var(--amber-600);
}

.notice span {
  display: block;
  margin-top: 3px;
  color: var(--ink-700);
}

/* Customer Dashboard hooks. */
#view-dashboard .topbar {
  margin-bottom: 20px;
}

#view-dashboard button.kpi-card,
#view-dashboard button.station-card {
  color: var(--ink-900);
  font: inherit;
  text-align: left;
}

#view-dashboard button.kpi-card {
  cursor: pointer;
}

#view-dashboard button.kpi-card:hover {
  border-color: var(--orange-500);
  box-shadow: 0 8px 22px rgb(18 25 43 / 8%);
}

.customer-line-chart {
  position: relative;
  min-height: 190px;
}

.customer-line-chart svg {
  width: 100%;
  height: 160px;
}

.customer-chart-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.customer-chart-plan,
.customer-chart-actual {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customer-chart-plan {
  stroke: #b8c5d8;
  stroke-dasharray: 7 5;
}

.customer-chart-actual {
  stroke: var(--orange-500);
}

.customer-chart-area {
  fill: color-mix(in srgb, var(--orange-500) 14%, transparent);
  stroke: none;
}

.customer-chart-labels {
  display: flex;
  justify-content: space-between;
  padding-left: 42px;
  color: var(--ink-400);
  font-size: 10px;
}

.customer-donut {
  border-radius: 50%;
  background: conic-gradient(
    var(--green-500) 0 var(--running),
    var(--amber-500) var(--running) var(--idle),
    var(--blue-500) var(--idle) var(--maintenance),
    var(--red-500) var(--maintenance) 100%
  );
}

.customer-donut::after {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: var(--card);
  content: "";
}

.customer-donut .donut-center {
  z-index: 1;
}

.station-scroll {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

button.station-card {
  cursor: pointer;
}

.customer-machine-icon {
  color: var(--orange-500);
  font-size: 34px;
}

.customer-station-diagram {
  width: 90px;
  height: 60px;
}

.customer-station-diagram rect,
.customer-station-diagram line {
  fill: none;
  stroke: #c9d0dc;
  stroke-width: 2;
}

.customer-station-diagram line {
  stroke-width: 1.5;
}

.customer-station-diagram .station-flow-arrow {
  fill: none;
  stroke: var(--orange-500);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.station-diagram {
  gap: 12px;
  color: var(--ink-500);
}

/* Customer Station hooks and functional checkpoint. */
.station-page-topbar {
  margin-bottom: 20px;
}

.station-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.station-crew-summary {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.blocked,
.status-pill.waiting {
  background: var(--amber-100);
  color: var(--amber-600);
}

.status-pill.blocked::before,
.status-pill.waiting::before {
  background: var(--amber-500);
}

.status-pill.ready {
  background: #e8f0fd;
  color: var(--blue-500);
}

.status-pill.ready::before {
  background: var(--blue-500);
}

.status-pill.offline,
.status-pill.hold {
  background: var(--red-100);
  color: var(--red-600);
}

.status-pill.offline::before,
.status-pill.hold::before {
  background: var(--red-500);
}

.customer-oee-ring {
  border-radius: 50%;
  background: conic-gradient(var(--green-500) 0 var(--oee), #eaecf0 var(--oee) 100%);
}

.customer-oee-ring::after {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: var(--card);
  content: "";
}

.customer-oee-ring .oee-center {
  z-index: 1;
}

.target-actual-summary {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 16px;
}

.target-actual-summary strong {
  font-size: 27px;
}

.target-actual-summary span {
  color: var(--ink-500);
  font-size: 13px;
}

.customer-target-chart {
  margin-top: 12px;
}

.customer-target-line-chart {
  min-height: 175px;
}

.customer-target-line-chart svg {
  width: 100%;
  height: 145px;
}

.customer-target-line-chart .customer-chart-labels {
  padding-left: 48px;
}

.customer-chart-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.customer-chart-y-label {
  fill: var(--ink-400);
  font-size: 9px;
  font-weight: 600;
}

.customer-target-plan,
.customer-target-actual {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customer-target-plan {
  stroke: var(--blue-500);
}

.customer-target-actual {
  stroke: var(--green-500);
}

.target-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #eef1f5;
}

.target-track i {
  position: absolute;
  inset: 0 auto 0 0;
}

.target-line {
  width: 100%;
  background: var(--blue-500);
  opacity: .3;
}

.actual-line {
  background: var(--green-500);
}

.target-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--ink-500);
  font-size: 10px;
}

.customer-bar-chart {
  position: relative;
  display: grid;
  height: 180px;
  grid-template-columns: repeat(9, 1fr);
  align-items: end;
  gap: 8px;
  padding: 18px 8px 24px;
  border-bottom: 1px solid var(--line);
}

.bar-column {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: end;
  justify-items: center;
}

.bar-column > span,
.bar-column > small {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.bar-column i {
  width: 60%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: #7c9cdb;
}

.takt-line {
  position: absolute;
  z-index: 3;
  right: 8px;
  left: 8px;
  border-top: 2px solid var(--orange-500);
}

.cycle-grid {
  position: absolute;
  z-index: 0;
  inset: 0 8px;
  pointer-events: none;
}

.cycle-grid span {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px solid var(--line);
}

.cycle-grid b {
  position: absolute;
  top: -7px;
  left: -2px;
  padding-right: 4px;
  background: var(--card);
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 600;
}

.takt-line span {
  position: absolute;
  right: 0;
  bottom: 5px;
  color: var(--orange-600);
  font-size: 9px;
  font-weight: 700;
}

.customer-checkpoint-card {
  margin-bottom: 16px;
}

.customer-checkpoint-head,
.customer-sequence-head,
.customer-checkpoint-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.customer-checkpoint-head small {
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 700;
}

.customer-checkpoint-head h3 {
  margin: 4px 0;
  font-size: 22px;
}

.customer-checkpoint-head p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
}

.customer-checkpoint-tabs {
  display: grid;
  grid-template-columns: repeat(var(--step-count), minmax(110px, 1fr));
  gap: 7px;
  margin: 16px 0;
}

.customer-checkpoint-tabs button {
  display: grid;
  min-width: 0;
  min-height: 76px;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-areas: "number short" "label label";
  align-items: center;
  gap: 4px 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink-700);
  text-align: left;
}

.customer-checkpoint-tabs button span {
  display: grid;
  width: 28px;
  height: 28px;
  grid-area: number;
  place-items: center;
  border: 2px solid #b8c1cc;
  border-radius: 50%;
  font-weight: 700;
}

.customer-checkpoint-tabs button strong {
  grid-area: short;
  font-size: 11px;
}

.customer-checkpoint-tabs button small {
  grid-area: label;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-checkpoint-tabs button.is-done {
  background: var(--green-100);
}

.customer-checkpoint-tabs button.is-done span {
  border-color: var(--green-600);
  background: var(--green-600);
  color: #fff;
}

.customer-checkpoint-tabs button.is-current {
  background: var(--amber-100);
}

.customer-checkpoint-tabs button.is-current span {
  border-color: var(--orange-500);
  background: var(--orange-500);
  color: #fff;
}

.customer-checkpoint-tabs button.is-selected {
  border-color: var(--blue-500);
  box-shadow: inset 0 -3px var(--blue-500);
}

.customer-plc-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.customer-plc-values article {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue-500);
  border-radius: 9px;
  background: #fafbfc;
}

.customer-plc-values small,
.customer-plc-values strong,
.customer-plc-values span {
  display: block;
}

.customer-plc-values small {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.customer-plc-values strong {
  margin: 5px 0 3px;
  font-size: 18px;
}

.customer-plc-values span {
  color: var(--green-600);
  font-size: 10px;
  font-weight: 700;
}

.customer-checkpoint-foot {
  margin-top: 12px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 600;
}

.customer-sequence-head {
  margin-bottom: 14px;
}

.customer-sequence-head small {
  color: var(--ink-500);
  font-size: 10px;
}

button.weld-pt {
  background: var(--card);
  color: var(--ink-900);
  cursor: pointer;
}

button.weld-pt:hover,
button.weld-pt.is-selected {
  border-color: var(--orange-500);
  box-shadow: inset 0 -3px var(--orange-500);
}

.customer-checkpoint-detail {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Existing utility/workforce pages keep behavior but inherit customer surfaces. */
.utility-view,
.team-view,
.workforce-view {
  padding: 22px 26px 40px;
}

.section-head h2 {
  color: var(--ink-900);
}

.utility-card,
.summary-card,
.team-summary-card,
.attendance-summary-card,
.operator-tracking,
.staffing-board,
.available-roster,
.assign-modal {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.workforce-toolbar {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--card);
}

.modal-backdrop {
  z-index: 100;
}

@media (max-width: 1100px) {
  .customer-legacy-page,
  #view-station,
  .utility-view,
  .team-view,
  .workforce-view {
    padding: 18px;
  }

  .customer-checkpoint-tabs {
    overflow-x: auto;
  }

  .customer-plc-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .sidebar {
    visibility: hidden;
    pointer-events: none;
  }

  .sidebar-reopen {
    display: grid;
    place-items: center;
  }

  .customer-legacy-page,
  #view-station,
  .utility-view,
  .team-view,
  .workforce-view {
    padding: 14px 12px 24px;
  }

  .topbar,
  .station-header,
  .station-header-actions,
  .customer-checkpoint-head,
  .customer-checkpoint-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-plc-values {
    grid-template-columns: 1fr;
  }
}

/* Customer sidebar primitives: V2 behavior, customer presentation. */
.sidebar .brand {
  min-height: 64px;
  padding: 12px 14px;
  border-bottom: 0;
  border-radius: 0;
  background: linear-gradient(135deg, #f5631d, var(--orange-500));
}

.sidebar .brand-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sidebar .brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: calc(100% - 40px);
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 18%));
}

.sidebar .brand-name {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.sidebar .brand-tag {
  max-width: 190px;
  padding-right: 0;
  overflow: visible;
  color: #fff;
  font-size: 9px;
  font-style: italic;
  text-overflow: clip;
}

.profile-block .profile {
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.profile-block .avatar {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--orange-500);
}

.profile-scope {
  display: none;
}

.search {
  margin: 10px 10px 8px;
}

.search-box {
  min-height: 38px;
  border-color: rgb(255 255 255 / 12%);
  border-radius: 7px;
  background: rgb(255 255 255 / 4%);
}

.sidebar .nav-group summary,
.sidebar .nav-item {
  min-height: 40px;
  border-radius: 8px;
  color: #cbd3e1;
  font-size: 12px;
}

.sidebar .nav-group[open] summary,
.sidebar .nav-group summary:hover {
  background: rgb(243 113 31 / 13%);
  color: var(--orange-400);
}

.sidebar .nav-group > .nav-item,
.sidebar .station-links .nav-item {
  width: calc(100% - 20px);
  min-height: 36px;
  margin-left: 20px;
  padding: 7px 10px 7px 14px;
  border-left: 1px solid rgb(243 113 31 / 24%);
  color: #b9c3d4;
  font-size: 11px;
}

.sidebar .nav-item.is-active {
  border-left-color: var(--orange-500);
  background: #38232e;
  color: #fff;
}

.sidebar .nav-item.is-active em,
.sidebar .nav-item.is-enabled em {
  color: var(--orange-400);
}

.sidebar .station-links .nav-item em {
  font-size: 8px;
}

.admin-foot {
  padding: 12px 16px 14px;
  border-top: 1px solid rgb(255 255 255 / 9%);
  background: var(--navy-900);
}

.admin-action {
  min-height: 38px;
  border-color: rgb(255 255 255 / 12%);
  border-radius: 8px;
  background: rgb(255 255 255 / 5%);
}

/* Customer primitives for routes that have no dedicated customer template. */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.summary-card,
.utility-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
}

.summary-card {
  border-top: 4px solid var(--orange-500);
}

.summary-card small,
.summary-card p,
.utility-card p,
.utility-card li {
  color: var(--ink-500);
  font-size: 12px;
}

.summary-card h3,
.utility-card h3 {
  margin: 7px 0;
  color: var(--ink-900);
  font-size: 17px;
}

.summary-card dl {
  display: block;
  overflow: hidden;
  margin: 13px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-card dl div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.summary-card dl div:last-child {
  border-bottom: 0;
}

.summary-card dt {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.summary-card dd {
  min-width: 0;
  margin: 0;
  overflow: visible;
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.primary-button {
  border: 1px solid var(--orange-500);
  background: var(--orange-500);
  color: #fff;
}

.primary-button:hover {
  border-color: var(--orange-600);
  background: var(--orange-600);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-700);
}

.danger-button {
  border: 1px solid var(--red-500);
  background: var(--card);
  color: var(--red-600);
}

.skill-tags span,
.status-chip,
.crew-chip {
  border-radius: 999px;
}

.operator-tracking__row:hover,
.workforce-roster__row:hover,
.staffing-card:hover,
.summary-card:hover {
  background: color-mix(in srgb, var(--card) 94%, var(--orange-500));
}

.utility-output {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange-500);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--ink-700);
}

.utility-output[hidden] {
  display: none;
}

.utility-output > strong {
  color: var(--ink-900);
}

.utility-flow,
.utility-report-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.utility-flow b,
.utility-report-grid span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.utility-flow i {
  align-self: center;
  color: var(--orange-500);
  font-style: normal;
}

/* Login composed from the same customer brand, card and form primitives. */
.login-header {
  border-bottom: 0;
  background: linear-gradient(135deg, #f5631d, var(--orange-500));
}

.login-header .theme-toggle {
  border-color: rgb(255 255 255 / 45%);
  background: rgb(255 255 255 / 12%);
  color: #fff;
}

.login-header .brand small,
.login-header .brand strong {
  color: #fff;
}

.login-card {
  border-color: var(--line);
  border-top: 4px solid var(--orange-500);
  border-radius: var(--radius);
  box-shadow: none;
}

.login-card input {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink-900);
}

.login-chip {
  min-height: 76px;
  border-color: var(--line);
  border-left: 4px solid var(--blue-500);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
}

.login-chip.role-supervisor {
  border-left-color: var(--orange-500);
}

.login-chip.is-selected {
  border-color: var(--orange-500);
  border-left-width: 4px;
  background: var(--amber-100);
}

.login-chip strong,
.login-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Natural document scrolling and customer-styled long-form pages. */
html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-color: var(--ink-400) var(--bg);
  scrollbar-width: auto;
}

body {
  min-height: 100vh;
  overflow: visible;
}

.app {
  height: auto;
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start;
}

.sidebar nav.nav {
  overflow-y: auto;
  scrollbar-color: #5d6a80 var(--navy-900);
  scrollbar-width: thin;
}

.workspace {
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
}

.app[data-view="station"] .workspace,
.app[data-view="station"] #view-station {
  height: auto !important;
  min-height: 100vh;
  overflow: visible !important;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
}

.app[data-view="station"] #view-station {
  padding: 22px 26px 48px;
}

.app[data-view="station"] #view-station .station-shell {
  display: block;
  height: auto !important;
  min-height: 0;
  overflow: visible !important;
}

.view,
#view-dashboard.is-active,
.team-view.is-active,
.workforce-view.is-active {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

.team-view.is-active,
.workforce-view.is-active {
  display: block;
  padding: 22px 26px 48px;
}

.team-view .section-head,
.workforce-view .section-head,
.utility-view .section-head {
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.team-view .section-head p,
.workforce-view .section-head p,
.utility-view .section-head p {
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
}

.team-view .section-head h2,
.workforce-view .section-head h2,
.utility-view .section-head h2 {
  margin-top: 4px;
  color: var(--ink-900);
  font-size: 26px;
}

.team-summary,
.attendance-summary {
  gap: 14px;
  margin-bottom: 16px;
}

.team-summary-card,
.attendance-summary-card {
  min-height: 92px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: none;
}

.team-summary-card small,
.team-summary-card span,
.attendance-summary-card small,
.attendance-summary-card span {
  color: var(--ink-500);
  font-size: 11px;
}

.team-summary-card strong,
.attendance-summary-card strong {
  margin: 6px 0;
  color: var(--ink-900);
  font-size: 25px;
}

.workforce-toolbar {
  min-height: 58px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
}

.workforce-toolbar label,
.workforce-toolbar > span {
  color: var(--ink-500);
  font-size: 11px;
}

.workforce-toolbar input,
.assign-list input {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink-900);
  font-size: 12px;
}

.workforce-layout {
  display: grid;
  grid-template-columns: minmax(430px, .95fr) minmax(560px, 1.2fr);
  gap: 16px;
  overflow: visible;
}

.staffing-board,
.available-roster,
.operator-tracking {
  max-height: none;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.workforce-section-head,
.operator-tracking__head {
  position: static;
  min-height: 46px;
  padding: 10px 12px;
  background: var(--surface-subtle);
}

.staffing-card {
  gap: 10px;
  margin: 10px;
  padding: 12px;
  border-radius: 9px;
}

.staffing-card__head strong {
  font-size: 13px;
}

.staffing-card__footer > span,
.staffing-card__head small,
.workforce-section-head small,
.operator-tracking__head span {
  font-size: 10px;
}

.operator-tracking__row,
.workforce-roster__row {
  min-height: 72px;
}

.operator-tracking__row strong,
.workforce-roster__row strong {
  font-size: 12px;
}

.operator-tracking__row small,
.workforce-roster__row small {
  font-size: 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.refresh-btn {
  border-radius: 8px;
  font-weight: 700;
}

.assign-modal {
  width: min(1040px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: var(--radius);
}

.customer-alarm-grid .is-wide {
  grid-column: 1 / -1;
}

.customer-weld-sequence {
  margin-top: 16px;
}

.sequence-totals {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 12px;
}

.station-source {
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.station-source .v {
  color: var(--orange-600);
  font-size: 9px;
}

.tabs button {
  padding: 5px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-400);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.tabs button.active {
  border-bottom-color: var(--orange-500);
  color: var(--orange-600);
}

@media (max-width: 1180px) {
  .workforce-layout {
    grid-template-columns: 1fr;
  }

  .operator-tracking,
  .available-roster {
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
  }

  .team-view.is-active,
  .workforce-view.is-active {
    padding: 14px 12px 28px;
  }

  .sequence-totals {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
