@import url('https://fonts.googleapis.com/css2?family=Mitr:wght@300;400;500&display=swap');

:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #eef2f4;
  --surface-blue: #e9f3ff;
  --ink: #111827;
  --muted: #718096;
  --faint: #9aa6b5;
  --line: #dfe6eb;
  --blue: #2f83f7;
  --blue-deep: #1769da;
  --green: #11b648;
  --green-soft: #e5f7eb;
  --red: #ff3344;
  --red-soft: #ffecef;
  --amber: #d98900;
  --radius-sm: 10px;
  --radius: 14px;
  --shadow: 0 14px 35px rgba(37, 53, 71, .09), 0 3px 8px rgba(37, 53, 71, .05);
  --font: 'Mitr', 'Avenir Next', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

button, select { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: .42; }

button, input, select, textarea { color: inherit; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(47, 131, 247, .28);
  outline-offset: 2px;
}

::selection { color: #fff; background: var(--blue-deep); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #e9eef1; }
::-webkit-scrollbar-thumb { background: #b8c2cc; border: 3px solid #e9eef1; border-radius: 999px; }

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon--small { width: 16px; height: 16px; }

.app-shell { min-height: 100vh; }

.topbar {
  position: relative;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(196, 205, 213, .45);
  background: rgba(248, 250, 251, .96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.brand-mark { display: flex; gap: 3px; transform: skew(-14deg); }
.brand-mark i { display: block; width: 16px; height: 23px; border-radius: 4px 2px; background: var(--blue); }

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  color: #536276;
  text-decoration: none;
  white-space: nowrap;
  font-size: 12.5px;
  transition: background-color 180ms ease-out, color 180ms ease-out;
}
.nav-link:hover { color: var(--ink); background: #eef2f4; }
.nav-link[aria-current='page'] { color: var(--blue-deep); background: #e4f0ff; }
.nav-link .icon { width: 17px; height: 17px; }

.top-actions { display: flex; min-width: 172px; align-items: center; justify-content: flex-end; gap: 9px; padding-left: 14px; }
.icon-button, .quiet-button, .primary-button, .danger-button {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 40px;
  transition: background-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
}
.icon-button { position: relative; display: grid; width: 40px; padding: 0; place-items: center; background: #ecf1f4; color: #334155; }
.icon-button:hover { background: #e0e7ec; color: var(--blue-deep); }
.notification-dot { position: absolute; right: 9px; top: 8px; width: 7px; height: 7px; border: 2px solid #ecf1f4; border-radius: 50%; background: var(--red); }
.avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: #e1edff; color: var(--blue-deep); font-weight: 500; }

.popover {
  position: fixed;
  z-index: 90;
  right: 28px;
  top: 62px;
  width: min(340px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.popover h2 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.popover-list { display: grid; gap: 5px; max-height: 330px; overflow: auto; }
.popover-row { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.popover-row:last-child { border-bottom: 0; }

.page { padding: 5px 32px 30px; }
.page-heading {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) auto;
  align-items: start;
  gap: 20px;
  min-height: 82px;
  padding-top: 7px;
}
.title-group { display: flex; align-items: center; gap: 16px; }
.warehouse-inline { margin-left: 4px; }
.warehouse-inline .select-control { min-height: 36px; max-width: 128px; padding-inline: 9px; font-size: 11px; }
.back-button { width: 40px; }
.page-title { margin: 0; font-size: 36px; line-height: 1.05; font-weight: 400; letter-spacing: -.025em; }
.page-id { margin-top: 6px; color: var(--muted); font-size: 12px; }
.demo-label { display: inline-flex; align-items: center; gap: 7px; margin-left: 9px; color: var(--muted); font-size: 11px; }
.demo-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.warehouse-overview-page { padding-top: 24px; }
.warehouse-overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.warehouse-overview-heading h1 { margin: 0; font-size: 36px; font-weight: 400; letter-spacing: -.025em; }
.warehouse-overview-heading p { margin: 7px 0 0; color: var(--muted); }
.warehouse-directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.warehouse-choice { display: grid; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-align: left; transition: border-color 180ms ease-out, background-color 180ms ease-out; }
.warehouse-choice:hover { border-color: #afd2fd; background: #fbfdff; }
.warehouse-choice-head, .warehouse-choice-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.warehouse-choice-head { padding: 20px 20px 16px; }
.warehouse-choice-head strong, .warehouse-choice-head small, .warehouse-choice-foot strong, .warehouse-choice-foot small { display: block; }
.warehouse-choice-head strong { font-size: 22px; font-weight: 400; letter-spacing: -.025em; }
.warehouse-choice-head small, .warehouse-choice-foot small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.warehouse-preview { position: relative; display: block; width: calc(100% - 24px); height: 230px; overflow: hidden; margin: 0 12px; padding: 0; border: 0; border-radius: 12px; background: var(--surface-soft); text-align: left; transition: background-color 180ms ease-out; }
.warehouse-preview:hover { background: #e6edf1; }
.warehouse-preview-routes, .warehouse-preview-objects { position: absolute; inset: 0; width: 100%; height: 100%; }
.warehouse-preview-objects { pointer-events: none; }
.warehouse-preview > small { position: absolute; left: 12px; top: 10px; color: var(--muted); font-size: 9px; }
.warehouse-preview-object, .warehouse-preview-robot, .warehouse-preview-alert { position: absolute; left: var(--map-x); top: var(--map-y); display: block; transform: translate(-50%, -50%); }
.warehouse-preview-object { width: 28px; height: 32px; border: 1px solid #0c8d39; border-radius: 4px; background: var(--green); }
.warehouse-preview-object--rack { width: 72px; height: 52px; border-color: #1269de; border-radius: 7px; background: var(--blue); box-shadow: 0 6px 7px rgba(51, 65, 85, .13); }
.warehouse-preview-object--charger { width: 24px; height: 36px; border-color: #a7afb4; background: #f4f3ed; }
.warehouse-preview-object--packing { width: 30px; }
.warehouse-preview-robot { width: 18px; height: 13px; border: 2px solid #078535; border-radius: 5px; background: #a7efbc; }
.warehouse-preview-alert { width: 0; height: 0; border-right: 9px solid transparent; border-bottom: 16px solid var(--red); border-left: 9px solid transparent; }
.warehouse-choice-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px 20px; }
.warehouse-choice-stats > span { padding: 0 14px; border-left: 1px solid var(--line); }
.warehouse-choice-stats > span:first-child { padding-left: 0; border-left: 0; }
.warehouse-choice-stats strong, .warehouse-choice-stats small { display: block; }
.warehouse-choice-stats strong { font-size: 20px; font-weight: 400; font-variant-numeric: tabular-nums; }
.warehouse-choice-stats small { color: var(--muted); font-size: 9px; }
.warehouse-choice-foot { min-height: 72px; padding: 14px 20px; border-top: 1px solid var(--line); background: #f8fafb; }
.warehouse-choice-foot strong { overflow: hidden; max-width: 46ch; font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.warehouse-choice-open { display: inline-flex; min-height: 40px; flex: 0 0 auto; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--blue-deep); font-size: 11px; }
.warehouse-choice-open:hover { color: var(--ink); }

.heading-tools { display: flex; align-items: center; gap: 10px; }
.select-control, .segmented, .quiet-button, .primary-button, .danger-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: #e9eef2;
}
.select-control { max-width: 170px; border-radius: var(--radius-sm); }
.segmented { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border-radius: var(--radius-sm); }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.segmented button[aria-pressed='true'] { background: var(--surface); color: var(--blue-deep); }
.quiet-button { color: #3c4a5e; }
.quiet-button:hover { background: #dfe7ed; }
.primary-button { background: var(--blue); color: #fff; }
.primary-button:hover { background: var(--blue-deep); }
.danger-button { background: var(--red-soft); color: #d91e31; }
.danger-button:hover { background: #ffdde2; }

.metrics { display: flex; align-items: center; justify-content: center; gap: clamp(34px, 6vw, 86px); }
.metric { display: grid; grid-template-columns: auto 70px; grid-template-rows: auto auto; column-gap: 12px; align-items: end; min-width: 150px; }
.metric strong { font-size: 34px; line-height: 1; font-weight: 400; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-trend { display: inline-block; width: 11px; height: 11px; margin-left: 6px; border-radius: 3px; background: var(--green); vertical-align: 8px; }
.metric span { grid-column: 1; margin-top: 7px; color: var(--muted); font-size: 12px; }
.metric-spark { grid-column: 2; grid-row: 1 / 3; display: flex; height: 42px; align-items: end; gap: 3px; }
.metric-spark i { width: 2px; height: var(--h); background: #d8e0e6; }
.metric-spark i.hot { background: var(--spark, var(--green)); }

.warehouse-grid { display: grid; grid-template-columns: 339px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.operations-panel {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 512px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid rgba(207, 217, 224, .72);
  border-radius: var(--radius);
  background: rgba(244, 247, 248, .9);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 13px; }
.panel-heading h2 { margin: 0; font-size: 17px; font-weight: 300; letter-spacing: -.02em; }
.panel-actions { display: flex; gap: 7px; }
.panel-actions .icon-button { width: 44px; border: 1px solid #c3ced8; background: #fff; }
.filter-row { display: flex; gap: 6px; padding-bottom: 13px; border-bottom: 1px solid rgba(255, 255, 255, .75); }
.filter-button { flex: 1; min-height: 36px; padding: 0 8px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .58); color: #4b5a6f; font-size: 12px; }
.filter-button:first-child { flex: .45; }
.filter-button { transform: translateY(14px); }
.filter-button[aria-pressed='true'] { background: #fff; color: var(--ink); box-shadow: 0 5px 14px rgba(51, 65, 85, .06); }
.filter-button i, .status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--green); }
.filter-button[data-filter='employed'] i, .status-dot--moving, .status-dot--paused, .status-dot--maintenance { background: var(--red); }

.robot-rows { display: grid; gap: 7px; margin-top: 11px; overflow: auto; }
.robot-row { border: 0; border-radius: 12px; background: rgba(255, 255, 255, .66); color: inherit; text-align: left; }
.robot-row:hover { background: rgba(255, 255, 255, .9); }
.robot-row.is-selected { background: #f8fafb; box-shadow: 0 10px 25px rgba(42, 62, 82, .09); }
.robot-summary { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 8px 10px; border: 0; background: transparent; text-align: left; }
.robot-glyph { display: grid; width: 36px; height: 30px; place-items: center; border-radius: 9px; background: #e9eef1; color: #526173; }
.robot-name { overflow: hidden; font-size: 13px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.robot-status { display: flex; align-items: center; margin-top: 2px; color: var(--muted); font-size: 10.5px; text-transform: capitalize; }
.robot-detail { min-height: 142px; padding: 0 11px 20px; }
.robot-row.is-selected .robot-detail { min-height: 177px; }
.battery-label { display: flex; justify-content: space-between; margin: 2px 1px 6px; color: #536276; font-size: 11px; }
.battery-track { height: 3px; border-radius: 99px; background: #d7e0e6; }
.battery-track i { display: block; width: var(--battery); height: 100%; border-radius: inherit; background: var(--battery-color, var(--green)); }
.task-mini { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin-top: 12px; padding: 12px; border-radius: 10px; background: #f7f9fa; font-size: 10.5px; }
.task-mini span { color: var(--muted); }
.task-mini strong { font-weight: 400; }
.payload-table { display: grid; grid-template-columns: .75fr 1.35fr .7fr .85fr; gap: 12px 8px; min-height: 125px; margin-top: 14px; padding: 13px 10px; border-radius: 10px; background: #fff; font-size: 9.5px; align-content: start; }
.payload-table span { color: var(--muted); }
.payload-table strong { overflow: hidden; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.payload-state { color: var(--green); }

.warehouse-stage { min-width: 0; }
.map-card {
  position: relative;
  min-height: 512px;
  overflow: hidden;
  border: 1px solid #e4e9ed;
  border-radius: var(--radius);
  background: #eef2f4;
}
.map-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(205, 216, 224, .28); }
.map-toolbar { position: absolute; z-index: 4; right: 14px; top: 14px; display: flex; gap: 7px; }
.map-toolbar .quiet-button { background: rgba(255, 255, 255, .88); }
.warehouse-canvas { position: relative; width: 100%; height: 512px; transition: transform 180ms ease-out; }
.warehouse-map, .map-objects { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-objects { pointer-events: none; }
.map-object, .map-junction { position: absolute; left: var(--map-x); top: var(--map-y); transform: translate(-50%, -50%); }
.map-object { z-index: 2; padding: 0; border: 0; background: transparent; pointer-events: auto; }
.map-object > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.map-junction { z-index: 1; width: 10px; height: 10px; border: 2px solid #dff7e7; border-radius: 50%; background: var(--green); }
.route-line { fill: none; stroke: var(--green); stroke-width: .45; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.route-line--main { stroke-width: .65; stroke-dasharray: 70 5; animation: route-flow 5s linear infinite; }
.route-line--branch { stroke: #8ccfa4; stroke-width: .38; }
.route-line--blocked { stroke: var(--red); stroke-width: .8; stroke-dasharray: 2 1.5; }
.rack { width: clamp(118px, 10vw, 176px); aspect-ratio: 4 / 3; cursor: pointer; filter: drop-shadow(0 7px 5px rgba(51, 65, 85, .16)); }
.rack-base { fill: #d7e0e8; }
.rack-face { fill: var(--blue); stroke: #1269de; stroke-width: .35; }
.rack-grid { stroke: rgba(255, 255, 255, .9); stroke-width: .28; }
.rack:focus .rack-face, .rack:hover .rack-face { fill: #176fdf; stroke: #0c56b8; stroke-width: .7; }
.rack.is-focused .rack-face, .station.is-focused rect { stroke: #fff; stroke-width: 1.2; filter: drop-shadow(0 0 4px var(--blue)); }
.station { width: clamp(48px, 4vw, 68px); aspect-ratio: 5 / 6; cursor: pointer; filter: drop-shadow(0 6px 4px rgba(29, 80, 43, .18)); }
.station--staging { width: clamp(108px, 9vw, 156px); aspect-ratio: 11 / 4; }
.station--charger { width: clamp(44px, 3.6vw, 58px); aspect-ratio: 5 / 7; }
.station rect { fill: #21b855; stroke: #0c8d39; stroke-width: .35; }
.station-grid { stroke: #096f2d; stroke-width: .38; }
.station:hover rect, .station:focus rect { fill: #0da844; }
.station--charger rect { fill: #f4f3ed; stroke: #a7afb4; }
.station--charger .station-grid { stroke: #a7afb4; }
.warning-target { width: 54px; aspect-ratio: 8 / 7; }
.blocked-icon { fill: var(--red); filter: drop-shadow(0 4px 5px rgba(255, 51, 68, .22)); }
.blocked-mark { stroke: white; stroke-width: 1; stroke-linecap: round; }
.robot-map { width: clamp(50px, 4vw, 64px); aspect-ratio: 1; cursor: pointer; transition: left 950ms linear, top 950ms linear; filter: drop-shadow(0 5px 4px rgba(15, 74, 38, .22)); }
.robot-map .robot-body { fill: #20b652; stroke: #0c8e38; stroke-width: .35; }
.robot-map .robot-top { fill: #a7efbc; }
.robot-map .robot-eye { fill: #0e6f32; }
.robot-ring { fill: transparent; stroke: transparent; }
.robot-map.is-selected .robot-ring { stroke: var(--blue); stroke-width: .7; }
.robot-map:focus .robot-ring { stroke: var(--blue); stroke-width: .9; }

.robot-popover {
  position: absolute;
  z-index: 6;
  width: 192px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(248, 250, 251, .97);
  box-shadow: var(--shadow);
  transform: translate(-10%, -38%);
}
.robot-popover::after { content: ''; position: absolute; left: 28px; bottom: -7px; width: 14px; height: 14px; background: #f8fafb; transform: rotate(45deg); }
.robot-popover .task-mini { background: #fff; }
.robot-popover-head { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 9px; padding-right: 20px; }
.robot-popover-head > .icon-button { position: absolute; right: -4px; top: 2px; width: 28px; min-height: 28px; }
.popover-robot-glyph { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 9px; background: #3f4548; color: #f0c94b; }
.robot-popover h3 { margin: 0; overflow: hidden; font-size: 12px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.robot-popover p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.robot-popover > .battery-label { margin-bottom: 7px; }
.robot-popover-head + .battery-label { margin-top: 16px; }
.popover-actions { position: relative; z-index: 1; display: flex; gap: 6px; margin-top: 12px; }
.popover-actions button { flex: 1; min-height: 34px; padding: 0 8px; font-size: 11px; }
.robot-popover .popover-actions button { background: #fff; color: var(--ink); }
.popover-base { width: 100%; min-height: 40px; margin-top: 12px; border: 0; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 400; }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 0; }
.chart-panel { position: relative; min-height: 220px; padding: 18px 20px 15px; border-radius: var(--radius); background: rgba(255, 255, 255, .78); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.chart-head h2 { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: -.02em; }
.chart-value { margin-top: 10px; font-size: 38px; font-weight: 300; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.chart-value small { color: var(--muted); font-size: 15px; }
.demo-badge { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #eef2f4; color: var(--muted); font-size: 10px; }
.chart-metric-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.chart-progress { width: 145px; flex: 0 0 145px; }
.chart-progress span { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.chart-progress strong { color: var(--ink); font-weight: 400; }
.chart-progress > i { display: block; height: 3px; margin-top: 6px; background: var(--line); }
.chart-progress b { display: block; width: var(--value); height: 100%; background: var(--green); }
.floor-control { border-color: #d8e1e7; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); }
.floor-control > span { display: inline-grid; color: #516174; place-items: center; }
.floor-control > span .icon { stroke-width: 2.2; }
.bar-plot { display: flex; height: 150px; gap: 8px; margin-top: 10px; }
.bar-axis { display: flex; width: 26px; flex: 0 0 26px; flex-direction: column; justify-content: space-between; padding-bottom: 18px; color: var(--muted); font-size: 9px; }
.bar-chart { display: flex; min-width: 0; height: 150px; flex: 1; align-items: end; gap: clamp(8px, 2.1vw, 28px); padding: 0 8px 20px; border-bottom: 1px solid #dfe6eb; }
.bar-group { position: relative; display: flex; flex: 1; align-items: end; justify-content: center; gap: 4px; height: 100%; }
.bar-group i { width: 4px; height: var(--h); background: #dbe3e8; }
.bar-group i:nth-child(n + 2) { background: var(--green); }
.bar-group span { position: absolute; bottom: -20px; color: var(--muted); font-size: 9px; }
.line-chart { width: 100%; height: 150px; margin-top: 10px; overflow: visible; }
.line-chart .axis { stroke: #dfe6eb; stroke-width: 1; }
.line-chart .area { fill: rgba(17, 182, 72, .09); }
.line-chart .line { fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .comparison { fill: none; stroke: #d0d8de; stroke-width: 1.5; }
.line-chart .line-point { fill: var(--green); stroke: #dff7e7; stroke-width: 4; }
.line-chart text { fill: var(--muted); font: 9px var(--font); }

/* Expanded operations workspaces */
.workspace-page { max-width: 1680px; margin: 0 auto; }
.workspace-heading { display: flex; min-height: 106px; align-items: flex-start; justify-content: space-between; gap: 28px; padding: 7px 0 22px; }
.workspace-heading h1 { margin: 0; font-size: clamp(32px, 3vw, 44px); font-weight: 400; letter-spacing: -.035em; line-height: 1.05; }
.workspace-heading > div:first-child > p:last-child { max-width: 700px; margin: 9px 0 0; color: var(--muted); }
.workspace-context { flex-wrap: wrap; justify-content: flex-end; }
.compact-field { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.compact-field > span { padding-left: 2px; }
.compact-field select, .data-toolbar select, .stack-form select, .stack-form input, .stack-form textarea, .inline-create-form input, .inline-create-form select, .message-compose select, .upload-form input {
  min-height: 40px;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.stack-form textarea, .message-compose textarea { min-height: 82px; resize: vertical; }
.data-layout { min-width: 0; }
.data-toolbar { display: flex; align-items: end; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.7); }
.search-field { display: flex; min-width: 280px; flex: 1; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.search-field input, .search-input { width: 100%; border: 0; outline: 0; background: transparent; }
.search-input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; }
.check-field { display: inline-flex; min-height: 40px; align-items: center; gap: 7px; color: #4b5a6f; font-size: 12px; white-space: nowrap; }
.check-field input { accent-color: var(--blue); }
.toolbar-count { margin-left: auto; padding: 0 8px 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }

.ledger-panel, .movement-column, .task-board, .lot-index, .lot-record-main, .document-index, .document-preview, .room-index, .thread-panel, .analysis-panel {
  min-width: 0;
  border: 1px solid rgba(211, 221, 228, .8);
  border-radius: var(--radius);
  background: rgba(255,255,255,.8);
}
.section-head { display: flex; min-height: 70px; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 400; letter-spacing: -.02em; }
.section-head p, .section-head > span { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.index-title { margin: 0 8px 12px; font-size: 18px; font-weight: 400; letter-spacing: -.02em; }
.detail-panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 12px 30px rgba(39, 56, 74, .05); }
.detail-panel h2 { margin: 0; font-size: 22px; font-weight: 400; line-height: 1.15; }
.detail-panel h3 { margin: 23px 0 9px; font-size: 13px; font-weight: 400; }
.record-id { margin: 6px 0 19px; color: var(--muted); font-size: 11px; }
.record-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.record-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 18px 0; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.record-metrics > div { display: grid; min-width: 0; padding: 12px; background: #f8fafb; }
.record-metrics span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.record-metrics strong { margin-top: 4px; font-size: 22px; font-weight: 400; font-variant-numeric: tabular-nums; }
.record-metrics--wide { grid-template-columns: repeat(4, 1fr); }
.record-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.record-list > div, .record-list > button { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 0; background: #fbfcfd; text-align: left; }
.record-list span { color: #48576a; font-size: 11px; }
.record-list strong { font-size: 10px; font-weight: 400; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 15px 0; padding: 12px; border-radius: 10px; background: var(--green-soft); color: #176b36; }
.notice--danger { background: var(--red-soft); color: #aa2030; }
.notice .icon { flex: 0 0 auto; }
.notice strong { font-weight: 500; }
.notice p { margin: 2px 0 0; font-size: 10.5px; }
.definition-list { display: grid; margin: 18px 0; }
.definition-list > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.definition-list dt { color: var(--muted); font-size: 10px; }
.definition-list dd { margin: 0; font-size: 11px; text-align: right; }
.status-pill { display: inline-flex; width: fit-content; min-height: 24px; align-items: center; padding: 3px 8px; border-radius: 999px; background: #edf1f4; color: #586678; font-size: 9.5px; font-weight: 400; white-space: nowrap; }
.status-pill--success { background: var(--green-soft); color: #078535; }
.status-pill--active { background: var(--surface-blue); color: var(--blue-deep); }
.status-pill--warning { background: #fff4db; color: #966100; }
.status-pill--danger { background: var(--red-soft); color: #c42235; }
.stack-form { display: grid; gap: 10px; }
.stack-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.stack-form button, .full-button { width: 100%; }
.action-disclosure { margin-top: 14px; border-top: 1px solid var(--line); }
.action-disclosure summary { padding: 14px 0; color: #344257; font-size: 11px; font-weight: 400; }
.emphasis-form { margin-top: 18px; padding: 14px; border-radius: 11px; background: #f4f7f9; }
.legal-note, .muted-copy { color: var(--muted); font-size: 9.5px; line-height: 1.6; }
.danger-text { color: var(--red) !important; }

/* Inventory */
.inventory-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; align-items: start; }
.table-scroll { min-width: 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 58px; padding: 9px 14px; border-bottom: 1px solid #e7ecef; color: #3d4a5c; vertical-align: middle; }
.data-table td > strong { color: var(--ink); font-weight: 400; }
.data-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.selectable-row { cursor: pointer; transition: background-color 150ms ease-out; }
.selectable-row:hover { background: #f5f8fa; }
.selectable-row.is-selected { background: #eaf3ff; box-shadow: inset 3px 0 var(--blue); }

/* Receiving and dispatch */
.new-movement-panel { margin-bottom: 14px; padding: 14px; border: 1px solid #bcd8fb; border-radius: var(--radius); background: var(--surface-blue); }
.inline-create-form { display: grid; grid-template-columns: 1fr 1fr 150px auto; align-items: end; gap: 10px; }
.inline-create-form--inbound { grid-template-columns: repeat(3, minmax(140px, 1fr)) 110px 150px minmax(140px, 1fr) auto; }
.inline-create-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.movement-layout { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(250px, .8fr) 340px; gap: 14px; align-items: start; }
.movement-column { min-height: 650px; background: #eef2f4; }
.movement-stack { display: grid; gap: 8px; padding: 12px; }
.movement-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; width: 100%; min-height: 104px; align-items: center; padding: 12px; border: 1px solid transparent; border-radius: 11px; background: rgba(255,255,255,.72); color: inherit; text-align: left; }
.movement-card:hover, .movement-card.is-selected { border-color: #bfd9fb; background: #fff; box-shadow: 0 8px 20px rgba(49, 68, 88, .06); }
.movement-card.is-selected { box-shadow: inset 3px 0 var(--blue); }
.movement-card > span:nth-child(2) { min-width: 0; }
.movement-card strong { display: block; font-weight: 400; }
.movement-card small, .movement-card time { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.movement-card time { grid-column: 2 / -1; margin: -4px 0 0; }
.movement-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 18px; }
.movement-icon--out { background: var(--surface-blue); color: var(--blue); }
.movement-detail { min-height: 650px; }
.step-rail { display: flex; justify-content: space-between; gap: 0; margin: 20px 0; padding: 0; list-style: none; }
.step-rail li { position: relative; display: grid; flex: 1; justify-items: center; gap: 5px; color: var(--faint); font-size: 8px; text-align: center; }
.step-rail li::before { content: ''; position: absolute; z-index: 0; left: -50%; right: 50%; top: 5px; height: 1px; background: var(--line); }
.step-rail li:first-child::before { display: none; }
.step-rail i { position: relative; z-index: 1; width: 11px; height: 11px; border: 2px solid #cbd5dd; border-radius: 50%; background: #fff; }
.step-rail .is-done i { border-color: var(--green); background: var(--green); }
.step-rail .is-done::before { background: var(--green); }
.step-rail .is-current { color: var(--ink); }
.line-items { display: grid; margin: 18px 0; border-block: 1px solid var(--line); }
.line-items > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.line-items span small { display: block; color: var(--muted); font-size: 9px; }

/* Robot dispatch */
.robots-layout { display: grid; grid-template-columns: 270px minmax(480px, 1fr) 330px; gap: 14px; align-items: start; }
.fleet-panel { min-height: 620px; padding: 0 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #e9eef2; }
.fleet-panel .section-head { margin-inline: -12px; }
.fleet-list { display: grid; gap: 7px; padding-top: 12px; }
.fleet-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 62px; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.7); color: inherit; text-align: left; }
.fleet-row.is-selected { border-color: #bcd8fb; background: #fff; }
.fleet-row strong, .fleet-row small { display: block; }
.fleet-row strong { font-weight: 400; }
.fleet-row small { color: var(--muted); font-size: 9px; }
.task-board { min-height: 620px; }
.progress-track { display: inline-block; width: 76px; height: 4px; overflow: hidden; border-radius: 99px; background: #dce4ea; }
.progress-track i { display: block; width: var(--progress); height: 100%; background: var(--green); }
.robot-record { min-height: 620px; }
.battery-hero { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 15px; margin: 22px 0; }
.battery-hero > span { font-size: 34px; font-weight: 300; }
.battery-hero strong { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 400; }
.route-preview { margin: 20px 0; overflow: hidden; border-radius: 11px; background: #eef3f5; }
.route-preview svg { display: block; width: 100%; height: 120px; }
.route-preview path { fill: none; stroke: var(--green); stroke-width: 2; }
.route-preview circle { fill: var(--green); stroke: #fff; stroke-width: 3; }
.route-preview text { fill: var(--muted); font: 9px var(--font); }
.record-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 16px; }
.record-actions button { flex: 1; min-width: 88px; }

/* Lots */
.lots-layout { display: grid; grid-template-columns: 280px minmax(440px, 1fr) 330px; gap: 14px; align-items: start; }
.lot-index { min-height: 690px; padding-bottom: 10px; background: #edf1f4; }
.lot-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: calc(100% - 20px); min-height: 70px; align-items: center; margin: 8px 10px 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.68); color: inherit; text-align: left; }
.lot-row.is-selected { border-color: #bcd8fb; background: #fff; box-shadow: inset 3px 0 var(--blue); }
.lot-row strong, .lot-row small { display: block; }
.lot-row strong { font-weight: 400; }
.lot-row small { overflow: hidden; max-width: 155px; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.lot-row > span:last-of-type { text-align: right; }
.lot-alert { position: absolute; right: -4px; top: -4px; display: grid; width: 19px; height: 19px; place-items: center; border: 3px solid #edf1f4; border-radius: 50%; background: var(--red); color: #fff; font-size: 9px; font-style: normal; }
.lot-record-main { min-height: 690px; padding: 24px; }
.lot-identity { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.lot-identity h1 { margin: 0; font-size: 31px; font-weight: 400; letter-spacing: -.03em; }
.lot-identity p:last-child { margin: 6px 0 0; color: var(--muted); }
.trace-section { margin-top: 24px; }
.trace-section .section-head { min-height: auto; padding: 0 0 12px; }
.trace-locations { display: grid; gap: 8px; }
.trace-locations article { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 66px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.trace-locations strong, .trace-locations small { display: block; }
.trace-locations small { color: var(--muted); font-size: 9px; }
.trace-locations article > span:last-child { color: var(--muted); font-size: 9px; text-align: right; }
.trace-node { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 9px; background: var(--surface-blue); color: var(--blue); }
.event-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.event-timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 10px; min-height: 56px; }
.event-timeline li::before { content: ''; position: absolute; left: 5px; top: 13px; bottom: -1px; width: 1px; background: #b9ddc5; }
.event-timeline li:last-child::before { display: none; }
.event-timeline i { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 2px; border: 3px solid #dff5e7; border-radius: 50%; background: var(--green); }
.event-timeline strong, .event-timeline time { display: block; font-weight: 400; }
.event-timeline time { margin-top: 3px; color: var(--muted); font-size: 9px; }

/* Documents */
.documents-layout { display: grid; grid-template-columns: 330px minmax(420px, 1fr) 320px; gap: 14px; align-items: stretch; min-height: 700px; }
.document-index { background: #edf1f4; }
.document-list { display: grid; gap: 7px; padding: 12px; }
.document-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; min-height: 78px; align-items: center; padding: 11px; border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,.72); color: inherit; text-align: left; }
.document-row.is-selected { border-color: #bcd8fb; background: #fff; box-shadow: inset 3px 0 var(--blue); }
.file-glyph { display: grid; width: 40px; height: 48px; place-items: center; border-radius: 6px 12px 6px 6px; background: var(--surface-blue); color: var(--blue); }
.document-row strong, .document-row small { display: block; }
.document-row strong { font-weight: 400; }
.document-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.document-row > i { padding: 3px 6px; border-radius: 99px; background: var(--green-soft); color: #087e34; font-size: 8px; font-style: normal; }
.document-preview { display: flex; flex-direction: column; overflow: hidden; background: #dfe5e9; }
.preview-toolbar { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 13px; border-bottom: 1px solid #ccd5dc; background: #f8fafb; }
.preview-toolbar strong, .preview-toolbar span { display: block; }
.preview-toolbar strong { font-weight: 400; }
.preview-toolbar span { color: var(--muted); font-size: 9px; }
.preview-toolbar a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.document-preview iframe, .document-preview img { width: calc(100% - 28px); min-height: 610px; height: 100%; margin: 14px; border: 0; background: #fff; box-shadow: 0 10px 26px rgba(43, 58, 73, .14); object-fit: contain; }
.pdf-sheet { width: min(520px, calc(100% - 56px)); min-height: 610px; margin: 28px auto; padding: 62px 52px; background: #fff; box-shadow: 0 10px 26px rgba(43, 58, 73, .14); }
.pdf-sheet > span { color: var(--blue); font-size: 10px; font-weight: 500; letter-spacing: .1em; }
.pdf-sheet h2 { margin: 34px 0 6px; font-size: 28px; font-weight: 400; }
.pdf-sheet > p { margin: 0 0 38px; color: var(--muted); }
.pdf-sheet dl { margin: 0 0 54px; }
.pdf-sheet dl div { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.pdf-sheet dt { color: var(--muted); }
.pdf-sheet dd { margin: 0; font-weight: 500; text-align: right; }
.pdf-sheet > small { display: block; color: var(--muted); line-height: 1.6; }
.file-fallback { display: grid; flex: 1; place-items: center; align-content: center; color: var(--muted); }
.file-fallback .icon { width: 58px; height: 58px; }
.upload-form { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.upload-form h3 { margin: 0 0 4px; }
.upload-form small { color: var(--muted); font-size: 8.5px; }

/* Team */
.team-layout { display: grid; grid-template-columns: 260px minmax(450px, 1fr) 320px; gap: 14px; min-height: 700px; }
.room-index { padding: 18px 12px; background: #e9eef2; }
.room-row { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: #445267; }
.room-row.is-selected { background: #fff; color: var(--blue-deep); }
.room-row small { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: #dde5ea; font-size: 9px; }
.room-index h3 { margin: 25px 8px 10px; color: var(--muted); font-size: 10px; font-weight: 400; text-transform: uppercase; }
.employee-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 9px; padding: 8px; }
.avatar--small { width: 32px; height: 32px; font-size: 9px; }
.employee-row strong, .employee-row small { display: block; }
.employee-row strong { font-size: 10px; font-weight: 400; }
.employee-row small { color: var(--muted); font-size: 8px; }
.thread-panel { display: grid; grid-template-rows: auto minmax(360px, 1fr) auto; overflow: hidden; }
.thread-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.thread-head h2 { margin: 0; font-size: 22px; font-weight: 400; }
.message-thread { overflow: auto; padding: 10px 20px; }
.message { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 11px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.message header { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.message header strong { font-weight: 400; }
.message header > span:not(.status-pill) { color: var(--muted); font-size: 9px; }
.message p { margin: 8px 0; color: #344257; line-height: 1.65; }
.reference-chip { min-height: 28px; margin: 3px 5px 0 0; padding: 0 9px; border: 1px solid #cce0f8; border-radius: 99px; background: #f0f6ff; color: var(--blue-deep); font-size: 9px; }
.message-compose { padding: 14px 20px; border-top: 1px solid var(--line); background: #f8fafb; }
.message-compose textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.message-compose > div { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; }
.message-compose label:not(.check-field) { display: grid; min-width: 150px; flex: 1; gap: 4px; color: var(--muted); font-size: 9px; }
.partner-panel { min-height: 700px; }
.partner-summary { display: grid; gap: 8px; margin-top: 18px; }
.partner-summary > div { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.partner-summary > div > span { color: var(--muted); font-size: 9px; }
.partner-summary .status-pill { grid-column: 2; grid-row: 1 / 3; }
.team-layout.is-partner .thread-panel { border-color: #bad5f8; }

/* Analytics */
.analytics-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.analytics-metrics > div { min-height: 120px; padding: 18px; background: rgba(255,255,255,.82); }
.analytics-metrics span, .analytics-metrics small { display: block; color: var(--muted); font-size: 9px; }
.analytics-metrics strong { display: block; margin: 8px 0 5px; font-size: 31px; font-weight: 300; }
.analytics-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; }
.analysis-panel { min-height: 360px; }
.utilization-chart { display: grid; gap: 15px; padding: 25px 20px; }
.utilization-chart > div { display: grid; grid-template-columns: 54px minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 10px; }
.utilization-chart i { height: 12px; overflow: hidden; border-radius: 2px; background: #e3e9ed; }
.utilization-chart b { display: block; width: var(--value); height: 100%; background: var(--blue); }
.utilization-chart strong { font-weight: 400; text-align: right; }
.analysis-line { display: block; width: calc(100% - 32px); height: 260px; margin: 10px 16px 16px; }
.analysis-line .analysis-gridline { fill: none; stroke: var(--line); stroke-width: 1; }
.analysis-line polyline { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.analysis-line circle { fill: var(--green); stroke: #dff7e7; stroke-width: 6; }
.analytics-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.analytics-tables .ledger-panel { overflow-x: auto; }

/* Dialogs and transient controls */
.app-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 28px 80px rgba(21, 33, 48, .24); }
.app-dialog::backdrop { background: rgba(26, 37, 51, .42); backdrop-filter: blur(3px); }
.app-dialog form { padding: 20px; }
.warehouse-summary-dialog { width: min(500px, calc(100vw - 28px)); }
.warehouse-summary-map { width: 100%; height: 170px; margin: 0; cursor: default; }
.warehouse-summary-map:hover { background: var(--surface-soft); }
.warehouse-summary-metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0 0; }
.warehouse-summary-metrics > div { padding: 12px 14px; border-top: 1px solid var(--line); }
.warehouse-summary-metrics > div:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line); }
.warehouse-summary-metrics dt { color: var(--muted); font-size: 9px; }
.warehouse-summary-metrics dd { margin: 4px 0 0; font-size: 18px; font-weight: 400; font-variant-numeric: tabular-nums; }
.warehouse-summary-focus { display: grid; gap: 4px; padding: 13px 14px; border-radius: var(--radius-sm); background: #f8fafb; }
.warehouse-summary-focus span { color: var(--muted); font-size: 9px; }
.warehouse-summary-focus strong { font-size: 11px; font-weight: 400; }
.location-summary-stock { display: grid; gap: 7px; margin-top: 14px; }
.location-summary-stock > span { color: var(--muted); font-size: 9px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.dialog-head h2 { margin: 0; font-size: 22px; font-weight: 400; }
.dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.form-grid select, .form-grid input { min-height: 42px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.setting-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; color: #3f4d61; }
.setting-row input { accent-color: var(--blue); }
.popover > .danger-button { margin-top: 14px; }
.map-card.is-fitted .warehouse-canvas { transform: scale(.94); transform-origin: center; }

.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { padding: 13px 15px; border-radius: var(--radius-sm); background: #172033; color: #fff; box-shadow: var(--shadow); animation: toast-in 220ms ease-out; }
.toast.error { background: #9f1625; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
@keyframes route-flow { to { stroke-dashoffset: -75; } }

.empty-state { padding: 28px; color: var(--muted); text-align: center; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 170px minmax(0, 1fr) auto; padding-inline: 18px; }
  .nav-link { padding-inline: 8px; }
  .nav-link span { display: none; }
  .warehouse-grid { grid-template-columns: 280px minmax(720px, 1fr); overflow-x: auto; }
  .metrics { gap: 24px; }
  .movement-layout { grid-template-columns: 1fr 1fr; }
  .movement-detail { grid-column: 1 / -1; min-height: auto; }
  .robots-layout, .lots-layout, .documents-layout, .team-layout { grid-template-columns: 250px minmax(480px, 1fr); overflow-x: auto; }
  .robots-layout .detail-panel, .lots-layout .detail-panel, .documents-layout .detail-panel, .team-layout .detail-panel { grid-column: 1 / -1; min-height: auto; }
}

@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .topbar { position: static; grid-template-columns: 1fr auto; min-height: 62px; padding: 0 14px; }
  .main-nav { grid-column: 1 / -1; justify-content: flex-start; margin: 0 -14px; padding: 4px 14px 8px; border-top: 1px solid var(--line); }
  .nav-link span { display: inline; }
  .top-actions .avatar { display: none; }
  .top-actions { min-width: auto; padding-left: 0; }
  .top-actions > .icon--small { display: none; }
  .page { padding: 14px; }
  .page-heading { grid-template-columns: 1fr; min-height: auto; margin-bottom: 16px; }
  .page-title { font-size: 30px; }
  .warehouse-overview-page { padding-top: 18px; }
  .warehouse-overview-heading h1 { font-size: 30px; }
  .warehouse-directory { grid-template-columns: 1fr; }
  .warehouse-preview { height: 190px; }
  .warehouse-choice-stats { grid-template-columns: 1fr 1fr; gap: 14px 0; }
  .warehouse-choice-stats > span:nth-child(3) { padding-left: 0; border-left: 0; }
  .warehouse-choice-foot { align-items: flex-start; flex-direction: column; gap: 10px; }
  .warehouse-choice-foot strong { max-width: 100%; white-space: normal; }
  .warehouse-inline { display: none; }
  .heading-tools { flex-wrap: wrap; }
  .metrics { order: 3; width: 100%; justify-content: flex-start; gap: 22px; overflow-x: auto; padding-bottom: 4px; }
  .metric { min-width: 125px; grid-template-columns: auto 52px; }
  .metric strong { font-size: 25px; }
  .warehouse-grid { display: flex; width: 100%; min-width: 0; flex-direction: column; overflow: visible; }
  .operations-panel { width: 100%; max-width: 100%; min-width: 0; min-height: auto; overflow: hidden; }
  .filter-row, .robot-row, .robot-detail, .robot-summary { min-width: 0; }
  .filter-row { display: grid; grid-template-columns: .58fr 1fr 1fr; }
  .filter-button, .filter-button:first-child { width: 100%; min-width: 0; padding-inline: 3px; font-size: 9.5px; }
  .payload-table { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 4px; font-size: 8px; }
  .robot-rows { max-height: 330px; }
  .warehouse-stage { width: 100%; min-width: 0; }
  .map-card { width: 100%; max-width: 100%; min-width: 0; min-height: 500px; overflow-x: auto; }
  .map-toolbar { left: 10px; right: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .map-toolbar label { grid-column: 1 / -1; }
  .map-toolbar .select-control { width: 100%; max-width: none; }
  .map-toolbar .quiet-button { min-width: 0; padding-inline: 11px; }
  .warehouse-canvas { width: 800px; min-width: 800px; height: 500px; }
  .robot-popover { left: auto !important; right: 12px; width: min(220px, calc(100% - 24px)); transform: translateY(-38%); }
  .chart-row { grid-template-columns: 1fr; }
  .chart-panel { min-width: 0; overflow: hidden; }
  .chart-head { flex-wrap: wrap; }
  .chart-metric-row { align-items: stretch; flex-direction: column; gap: 8px; }
  .chart-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
  .chart-value small { white-space: nowrap; }
  .chart-progress { width: 100%; flex: 0 0 auto; }
  .popover { right: 14px; }
  .workspace-heading { display: grid; min-height: auto; }
  .workspace-heading > div:first-child { min-width: 0; }
  .workspace-heading > div:first-child p { overflow-wrap: anywhere; }
  .workspace-context { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; justify-content: stretch; }
  .workspace-context .compact-field { min-width: 160px; }
  .workspace-context .role-toggle { min-width: 0; }
  .data-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; }
  .toolbar-count { margin-left: 0; padding: 0; }
  .inventory-layout, .movement-layout, .robots-layout, .lots-layout, .documents-layout, .team-layout, .analytics-grid, .analytics-tables { display: flex; flex-direction: column; overflow: visible; }
  .ledger-panel, .movement-column, .fleet-panel, .task-board, .lot-index, .lot-record-main, .document-index, .document-preview, .room-index, .thread-panel, .detail-panel { width: 100%; min-height: auto; }
  .data-table { min-width: 680px; }
  .record-metrics--wide, .analytics-metrics { grid-template-columns: 1fr 1fr; }
  .inline-create-form { grid-template-columns: 1fr; }
  .pdf-sheet { min-height: 520px; padding: 42px 28px; }
  .document-preview iframe, .document-preview img { min-height: 520px; }
  .message-thread { max-height: 520px; }
  .message > div { min-width: 0; }
  .message p { overflow-wrap: anywhere; }
  .partner-panel { min-height: auto; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
