:root {
  --ues-blue: #002d5b;
  --ues-blue-light: #004a8f;
  --ues-accent: #ff6d00;
  --bg: #eef2f6;
  --panel: #ffffff;
  --text: #1a202c;
  --muted: #5a6577;
  --line: #d7dee8;
  --font: "Inter", "Segoe UI", sans-serif;
  --display: "Outfit", "Inter", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.ark-shell { display: flex; flex-direction: column; height: 100vh; }
.ark-header {
  background: var(--ues-blue);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  padding: 0.7rem 1.5rem 0.7rem 1.35rem;
  z-index: 20;
  flex-wrap: nowrap;
}
.ark-brand { font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.04em; white-space: nowrap; }
.ark-brand span { opacity: 0.7; font-weight: 400; font-size: 0.78rem; margin-left: 0.7rem; padding-left: 0.7rem; border-left: 1px solid rgba(255,255,255,.3); }
.ark-nav { display: flex; gap: 0.35rem; flex-wrap: nowrap; flex-shrink: 0; }
.ark-nav a {
  color: #fff; text-decoration: none; font-size: 0.85rem; padding: 0.4rem 0.8rem; border-radius: 6px; opacity: 0.85;
}
.ark-nav a.active, .ark-nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.ark-user { margin-left: 0.5rem; font-size: 0.8rem; opacity: 0.85; white-space: nowrap; flex-shrink: 0; }
.alert-bell { position: relative; flex-shrink: 0; }
.bell-btn { position: relative; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--ues-accent); color: #fff; border-radius: 99px; font-size: 0.62rem; font-weight: 700;
  display: grid; place-items: center;
}
.bell-drop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(360px, 86vw);
  background: #fff; color: var(--text); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.18); padding: 0.4rem;
}
.bell-item { padding: 0.45rem 0.65rem; border-top: 1px solid var(--line); display: grid; gap: 0.15rem; }
.bell-item small { color: var(--muted); font-size: 0.72rem; }
.bell-drop a { display: block; padding: 0.5rem 0.7rem; color: var(--ues-blue); text-decoration: none; }
.settings-page, .page-with-nav { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; padding-top: 0.6rem; }
.settings-nav, .page-nav { position: sticky; top: 0; display: grid; align-content: start; gap: 0.25rem; }
.settings-nav h1, .page-nav h1 { font-size: 1.2rem; margin: 0.4rem 0 0.6rem; }
.settings-nav button, .page-nav button {
  text-align: left; border: 0; background: transparent; padding: 0.5rem 0.65rem; border-radius: 8px;
  font: inherit; color: var(--text); cursor: pointer;
}
.settings-nav button.on, .settings-nav button:hover,
.page-nav button.on, .page-nav button:hover { background: #e8f0f8; color: var(--ues-blue); }
.settings-body, .page-body { min-width: 0; }
.guardrail-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: .25rem 1.5rem; margin-top: .7rem; max-width: 820px; }
.ask-error { color: #a61b1b; background: #fff1f1; border: 1px solid #f0b8b8; border-radius: 7px; padding: .45rem .6rem; }
.ask-warning { color: #714300; background: #fff7df; border: 1px solid #ead49a; border-radius: 7px; padding: .45rem .6rem; font-size: .78rem; }
.region-legend { display: grid; gap: 0.2rem; margin: 0.35rem 0 0.7rem; }
.region-swatch {
  display: flex; align-items: center; gap: 0.4rem; border: 0; background: transparent;
  font: inherit; font-size: 0.75rem; color: var(--muted); cursor: pointer; padding: 0.15rem 0;
}
.region-swatch i { width: 10px; height: 10px; border-radius: 2px; background: var(--sw, #888); }
.doc-sheet {
  background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,20,50,.08);
  padding: 1.2rem 1.35rem; margin: 0.6rem 0 1rem; max-width: 760px;
}
.doc-sheet.paper-tabloid { max-width: 920px; }
.doc-sheet.paper-a4 { max-width: 700px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 3px solid var(--ues-blue); padding-bottom: 0.55rem; margin-bottom: 0.8rem; }
.doc-logo { font-family: var(--display); font-weight: 800; color: var(--ues-blue); letter-spacing: .06em; }
.doc-kicker { font-size: 0.72rem; color: var(--muted); }
.doc-stamp { border: 2px solid #9a3412; color: #9a3412; padding: 0.25rem 0.45rem; font-size: 0.68rem; font-weight: 800; transform: rotate(-6deg); }
.doc-foot { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.45rem; font-size: 0.72rem; color: var(--muted); display: flex; justify-content: space-between; }
.lab-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin: 0.45rem 0 0.8rem; }
.lab-table th, .lab-table td { border: 1px solid #e4ebf3; padding: 0.35rem 0.45rem; text-align: left; }
.lab-table th { background: #f6f8fb; color: var(--ues-blue); }
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.65rem; align-items: start; }
.kanban-col { background: #f6f8fb; border-radius: 12px; padding: 0.55rem; min-height: 120px; }
.kanban-col h3 { margin: 0 0 0.45rem; font-size: 0.82rem; color: var(--ues-blue); }
.kanban-card { background: #fff; border-radius: 10px; padding: 0.55rem 0.65rem; margin-bottom: 0.45rem; box-shadow: 0 4px 12px rgba(0,20,50,.05); }
.designer-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0 0.7rem; }
.hook-card { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem; align-items: center; }
.spark.tall { height: 56px; }
.spark i.s2 { background: #c2410c; }
.spark i.s3 { background: #0e7490; }
.equip-thumb { overflow: hidden; height: 110px; padding: 0; }
.equip-photo { width: 100%; height: 100%; object-fit: cover; display: block; background: #dbe4ef; }
.wf-canvas { display: grid; gap: 0.45rem; margin: 0.6rem 0; }
.wf-rail { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin: 0.45rem 0; }
.wf-node { background: #e8f0f8; color: var(--ues-blue); border-radius: 8px; padding: 0.2rem 0.45rem; font-size: 0.72rem; font-weight: 700; }
.wf-node.start, .wf-node.end { background: var(--ues-blue); color: #fff; border-radius: 99px; }
.wf-node.trigger { background: #fff7ef; color: #9a3412; }
.wf-node.action { background: #ecfdf5; color: #047857; }
.wf-edge { color: var(--muted); }
.wf-step {
  display: grid; grid-template-columns: 70px 1fr 1fr auto; gap: 0.4rem; align-items: center;
  background: #f6f8fb; border-radius: 8px; padding: 0.45rem 0.55rem;
}
.page-title-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.page-title-actions h2, .page-title-actions p { margin-top: 0; }
.widget-options {
  display: flex; flex-wrap: wrap; gap: .35rem; padding: .45rem; margin: .35rem 0 .65rem;
  background: #f6f8fb; border: 1px solid var(--line); border-radius: 9px;
}
.widget-options label { display: flex; align-items: center; gap: .3rem; padding: .2rem .45rem; font-size: .76rem; }
.timeline-widget .meta { border-left: 3px solid var(--ues-blue); padding: .28rem .55rem; margin: .25rem 0; }
.widget-catalog {
  margin: .45rem 0 .8rem; padding: .7rem; background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px;
}
.widget-catalog > header, .dashboard-widget-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem;
}
.widget-catalog-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .45rem; margin-top: .6rem;
}
.widget-catalog-grid button {
  display: flex; flex-direction: column; gap: .2rem; min-height: 76px; padding: .65rem; text-align: left;
  border: 1px solid #cbd8e5; border-radius: 8px; background: white; color: var(--ues-blue); cursor: pointer;
}
.widget-catalog-grid button:hover { border-color: var(--ues-blue); box-shadow: 0 3px 12px rgba(0,45,91,.08); }
.widget-catalog-grid span { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.custom-dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: .7rem; align-items: start;
}
.dashboard-widget { min-width: 0; margin: 0; overflow: hidden; }
.dashboard-widget-wide { grid-column: 1 / -1; }
.dashboard-widget-compact { padding: .65rem; }
.dashboard-widget-compact .dashboard-widget-head { margin-bottom: .35rem; }
.dashboard-widget-compact .stat { padding: .45rem; }
.dashboard-widget-head { margin-bottom: .55rem; }
.dashboard-widget-head > div:first-child { min-width: 0; }
.dashboard-widget-head[draggable="true"] { cursor: grab; user-select: none; }
.dashboard-widget-head[draggable="true"]:active { cursor: grabbing; }
.dashboard-widget-head.widget-dragging { opacity: .55; outline: 2px dashed var(--ues-orange); outline-offset: 4px; }
.dashboard-widget-head input, .dashboard-widget-head select, .dashboard-widget-head button { cursor: pointer; }
.widget-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem; }
.widget-actions button {
  border: 0; border-radius: 5px; padding: .18rem .35rem; background: #edf2f7; color: #42566b; font-size: .67rem; cursor: pointer;
}
.widget-actions button:hover { background: #dbe7f2; color: var(--ues-blue); }
.widget-config {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: .5rem; margin: 0 0 .65rem; padding: .55rem;
  border: 1px solid #cbd8e5; border-radius: 7px; background: #f8fafc;
}
.widget-config > label { display: grid; gap: .2rem; min-width: 155px; font-size: .7rem; color: var(--muted); }
.widget-config select { min-height: 32px; }
.widget-device-picker {
  width: 100%; max-height: 190px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: .25rem;
}
.widget-device-picker label {
  display: grid; grid-template-columns: 18px 1fr; column-gap: .25rem; padding: .3rem; border-radius: 5px; background: white; font-size: .73rem;
}
.widget-device-picker input { grid-row: 1 / 3; }
.widget-device-picker small { color: var(--muted); font-size: .64rem; }
.dashboard-status { grid-template-columns: repeat(4, 1fr); margin: 0; }
.widget-chart { min-height: 220px; }
.sensor-widget-row {
  display: grid; grid-template-columns: minmax(130px, .75fr) 1.25fr; gap: .6rem; align-items: center; padding: .38rem 0; border-top: 1px solid #e7edf3;
}
.sensor-widget-row > div:first-child { display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: .2rem; min-width: 0; }
.sensor-widget-row small { grid-column: 2; color: var(--muted); font-size: .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-widget-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-bottom: .45rem; }
.site-widget-stats span { padding: .5rem; border-radius: 6px; background: #f4f7fa; color: var(--muted); font-size: .67rem; }
.site-widget-stats b { display: block; color: var(--ues-blue); font-size: 1rem; }
.site-device-line, .alert-widget-line { display: flex; align-items: center; gap: .55rem; padding: .38rem 0; border-top: 1px solid #e7edf3; font-size: .72rem; }
.site-device-line > span, .alert-widget-line > span { flex: 1; min-width: 0; }
.site-device-line small { padding: .12rem .32rem; border-radius: 99px; background: #f5e9e9; color: #9b2c2c; }
.site-device-line small.online { background: #e5f5ed; color: #157347; }
.alert-widget-line .btn { margin-left: auto; }
.dashboard-kanban { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: .35rem; overflow-x: auto; }
.dashboard-kanban > div { min-width: 90px; padding: .4rem; border-radius: 7px; background: #f4f7fa; }
.dashboard-kanban b, .dashboard-kanban small { display: block; }
.dashboard-kanban b { color: var(--ues-blue); font-size: .72rem; }
.dashboard-kanban b span { float: right; color: var(--muted); }
.dashboard-kanban small { margin-top: .3rem; padding: .3rem; border-radius: 5px; background: white; color: #42566b; }
.dashboard-empty { max-width: 600px; text-align: center; padding: 2rem; }
@media (max-width: 720px) {
  .custom-dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-status { grid-template-columns: repeat(2, 1fr); }
  .sensor-widget-row { grid-template-columns: 1fr; }
}
.layer-group-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin: .65rem 0 .25rem; padding: .34rem .2rem; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700; cursor: pointer; text-align: left;
}
.layer-group-head:hover { color: var(--ues-blue); background: #f6f8fb; }
.layer-chevron { color: var(--ues-blue); font-size: 1.15rem; line-height: .7; }
.layer-help { font-size: .7rem; line-height: 1.35; margin: .25rem 0 .5rem; }
.sf-editor-shell {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; margin: .55rem 0 1rem; background: #fff; max-width: 100%;
}
.sf-editor-shell > .kicker { padding: .5rem .65rem; background: #f6f8fb; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.sf-editor-surface { height: clamp(430px, calc(100vh - 300px), 860px); width: 100%; overflow: hidden; }
.sf-editor-surface .e-documenteditorcontainer,
.sf-editor-surface .e-de-ctn { height: 100% !important; width: 100% !important; }
.sf-editor-surface .e-de-tool-ctn { flex-wrap: wrap; }

.wf-designer {
  display: grid; grid-template-columns: 232px minmax(0, 1fr) 306px; gap: .7rem;
  height: clamp(480px, calc(100vh - 268px), 820px); margin: .6rem 0 1rem;
}
.wf-designer > * {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  min-width: 0; min-height: 0; overflow: auto;
}
.wf-palette, .wf-inspector { padding: .55rem .6rem; display: flex; flex-direction: column; gap: .35rem; }
.wf-palette-group { display: flex; flex-direction: column; gap: .22rem; margin-bottom: .35rem; }
.wf-palette-head {
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: .4rem 0 .1rem;
}
.wf-chip {
  display: flex; align-items: center; gap: .4rem; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; color: var(--ink);
  padding: .3rem .45rem; font-size: .74rem; font-weight: 600;
}
.wf-chip:hover { border-color: var(--ues-blue); background: #eef6ff; }
.wf-chip-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: 0 0 auto; }
.wf-chip.trigger .wf-chip-dot { background: #c2410c; }
.wf-chip.condition .wf-chip-dot { background: #6d28d9; }
.wf-chip.action .wf-chip-dot { background: #0f766e; }

.wf-stage { display: flex; flex-direction: column; overflow: hidden; background: #f8fafc; }
.wf-stage-bar {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; flex: 0 0 auto;
  border-bottom: 1px solid var(--line); background: #fff;
}
.wf-stage-bar .meta { margin-left: auto; }
.wf-stage-canvas { position: relative; flex: 1 1 auto; min-height: 0; }
.wf-stage-canvas .e-diagram { height: 100% !important; width: 100% !important; }
.wf-stage-empty {
  position: absolute; inset: auto 12% 14% 12%; text-align: center; color: var(--muted);
  font-size: .78rem; pointer-events: none;
}
.wf-inspector label { display: flex; flex-direction: column; gap: .18rem; font-size: .74rem; color: var(--muted); }
.wf-inspector input, .wf-inspector textarea {
  width: 100%; padding: .35rem .45rem; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: .8rem;
}
.wf-step-card { border: 1px solid var(--line); border-left: 3px solid #94a3b8; border-radius: 8px; padding: .38rem .45rem; display: grid; gap: .3rem; }
.wf-step-card.trigger { border-left-color: #c2410c; }
.wf-step-card.condition { border-left-color: #6d28d9; }
.wf-step-card.action { border-left-color: #0f766e; }
.wf-step-head { display: flex; align-items: baseline; gap: .4rem; }
.wf-step-head .meta { margin-left: auto; font-size: .66rem; }
.wf-step-actions { display: flex; gap: .25rem; }
.wf-step-actions .btn { padding: .15rem .4rem; font-size: .7rem; }
@media (max-width: 1240px) {
  .wf-designer { grid-template-columns: 1fr; height: auto; }
  .wf-stage-canvas { height: 420px; }
}

.wx-marker {
  display: flex; align-items: center; gap: .18rem; padding: .16rem .4rem .16rem .3rem;
  background: #fff; border: 2px solid var(--ues-blue); border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 26, 56, .28); cursor: pointer; white-space: nowrap;
}
.wx-marker-ico { font-size: .82rem; line-height: 1; }
.wx-marker-temp { font-size: .74rem; font-weight: 800; color: var(--ues-blue); }
.wx-marker-risk { border-color: #b45309; background: #fff7e6; }
.wx-marker-risk .wx-marker-temp { color: #8a4b08; }
.pipeline-table .btn { margin-right: .25rem; }
.report-preview pre {
  white-space: pre-wrap; font: inherit; font-size: 0.82rem; background: #f6f8fb;
  border-radius: 8px; padding: 0.8rem; line-height: 1.45;
}
.spark-row { display: grid; grid-template-columns: 120px 1fr; gap: 0.4rem; align-items: end; margin: 0.35rem 0; font-size: 0.72rem; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 36px; }
.spark i { display: block; width: 5px; height: var(--h, 40%); background: var(--ues-blue); border-radius: 2px 2px 0 0; }
.drawer-head { display: flex; gap: 0.35rem; align-items: center; }
.drawer-close {
  border: 0; background: #f1f4f8; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1.1rem;
}
.style-pills.wrap { flex-wrap: wrap; }
.style-pills.wrap button { flex: 1 1 30%; }
.ark-user-menu { position: relative; flex-shrink: 0; margin-left: 0.25rem; }
.ark-user-btn {
  display: flex; align-items: center; gap: 0.55rem;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: #fff; border-radius: 999px; padding: 0.2rem 0.7rem 0.2rem 0.2rem;
  cursor: pointer; font: inherit;
}
.ark-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ues-accent);
  display: grid; place-items: center; font-size: 0.68rem; font-weight: 700;
}
.ark-user-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.ark-user-copy strong { font-size: 0.8rem; font-weight: 600; }
.ark-user-copy small { font-size: 0.65rem; opacity: 0.7; }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  background: #fff; color: var(--text); min-width: 200px;
  border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.18); padding: 0.4rem;
  display: grid;
}
.user-drop-meta { font-size: 0.72rem; color: var(--muted); padding: 0.45rem 0.7rem 0.35rem; }
.user-drop a, .user-drop button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--text); text-decoration: none; font: inherit; font-size: 0.88rem;
  padding: 0.5rem 0.7rem; border-radius: 8px; cursor: pointer;
}
.user-drop a:hover, .user-drop button:hover { background: #f4f7fb; }

.search-cluster {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 260px;
  max-width: 760px;
  margin-left: auto;
}
.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-wrap input {
  width: 100%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  outline: none;
}
.search-wrap.has-file input { padding-left: 8.4rem; }
.search-wrap input::placeholder { color: rgba(255,255,255,.65); }
.search-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.search-icon-btn input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.search-cog { position: relative; flex-shrink: 0; }
.search-cog-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50;
  background: #fff; color: var(--text); width: 280px;
  border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.18);
  padding: 0.9rem; display: grid; gap: 0.65rem;
}
.search-cog-panel label { display: grid; gap: 0.25rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.search-cog-panel select { font: inherit; font-size: 0.85rem; text-transform: none; letter-spacing: 0; color: var(--text); padding: 0.4rem 0.45rem; border-radius: 8px; border: 1px solid var(--line); }
.search-attach-chip {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  max-width: 7.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 0; background: rgba(255,255,255,.2); color: #fff; border-radius: 999px;
  font: inherit; font-size: 0.68rem; padding: 0.15rem 0.45rem; cursor: pointer; z-index: 1;
}
.search-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.search-filters select {
  min-width: 0; font-size: 0.8rem; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--text); padding: 0.35rem 0.45rem;
}
.page .search-filters select { display: inline-block; margin: 0; max-width: 240px; }
.search-drop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; color: var(--text); border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,.18); max-height: 420px; overflow: auto; z-index: 40;
}
.search-group { padding: 0.4rem 0.2rem; }
.search-group h4 { margin: 0; padding: 0.4rem 0.9rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.search-hit {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 0.55rem 0.9rem; cursor: pointer; font: inherit;
}
.search-hit:hover, .search-hit.active { background: #fff4eb; }
.search-hit strong { display: block; font-size: 0.88rem; }
.search-hit small { color: var(--muted); }

.ark-main { flex: 1; position: relative; min-height: 0; }
#ark-map { position: absolute; inset: 0; }

.layer-drawer {
  position: absolute; left: 16px; top: 16px; z-index: 10;
  background: var(--panel); border-radius: 12px; padding: 0.55rem 0.75rem 0.85rem;
  box-shadow: 0 10px 28px rgba(0,20,50,.12); width: 260px; max-height: calc(100% - 32px); overflow: auto;
}
.layer-drawer.collapsed { width: auto; padding: 0.35rem; }
.drawer-toggle {
  width: 100%; border: 0; background: var(--ues-blue); color: #fff; border-radius: 8px;
  padding: 0.4rem 0.6rem; font: inherit; font-size: 0.8rem; cursor: pointer; margin-bottom: 0.45rem;
}
.layer-drawer h3 { margin: 0.65rem 0 0.35rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.layer-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; margin: 0.3rem 0; }
.layer-row select { flex: 1; min-width: 0; font-size: 0.75rem; }
.layer-row:has(input:disabled) { opacity: 0.45; }
.style-pills { display: flex; gap: 0.3rem; margin: 0.25rem 0 0.45rem; }
.style-pills button {
  flex: 1; border: 1px solid var(--line); background: #fff; color: var(--ues-blue);
  border-radius: 7px; padding: 0.32rem 0.2rem; font: inherit; font-size: 0.72rem; cursor: pointer;
}
.style-pills button.on { background: var(--ues-blue); color: #fff; border-color: var(--ues-blue); }
.weather-strip {
  display: flex; align-items: center; gap: 0.7rem;
  background: #eef6ff; border: 1px solid #d5e6f6; border-radius: 12px;
  padding: 0.55rem 0.75rem; margin: 0.15rem 0 0.85rem;
}
.wx-badge {
  width: 40px; height: 40px; border-radius: 10px; background: #002d5b; color: #fff;
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.chip-svc { background: #e8f0f8; }

.dossier {
  position: absolute; top: 16px; right: 16px; bottom: 16px; width: min(440px, 92vw);
  background: var(--panel); border-radius: 16px; overflow: auto; z-index: 11;
  box-shadow: 0 18px 50px rgba(0,20,50,.18); padding: 1.1rem 1.15rem 1.4rem;
}
.dossier-close { float: right; border: 0; background: #f1f4f8; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }
.kicker { font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ues-accent); font-weight: 700; }
.dossier h2 { margin: 0.15rem 0 0; font-family: var(--display); font-size: 1.35rem; color: var(--ues-blue); }
.meta { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 0.8rem; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.9rem; }
.stat { background: #f6f8fb; border-radius: 10px; padding: 0.55rem 0.7rem; }
.stat label { display: block; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-size: 0.92rem; color: var(--ues-blue); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 0.9rem; }
.chip { background: #e8f0f8; color: var(--ues-blue); font-size: 0.72rem; padding: 0.22rem 0.5rem; border-radius: 999px; font-weight: 600; }
.section-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1rem 0 0.45rem; }
.asset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.asset-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 0.7rem;
  text-align: left; cursor: pointer; font: inherit;
}
.asset-btn:hover { border-color: var(--ues-accent); background: #fffaf4; }
.asset-btn strong { display: block; font-size: 0.8rem; color: var(--ues-blue); }
.asset-btn small { color: var(--muted); font-size: 0.72rem; }
.timeline { border-left: 2px solid #e4ebf3; margin-left: 0.4rem; padding-left: 0.8rem; }
.tl-item { margin: 0 0 0.7rem; font-size: 0.84rem; }
.tl-item time { display: block; font-size: 0.7rem; color: var(--muted); }
.sensor-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.sensor {
  border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.6rem; font-size: 0.8rem;
}
.sensor b { color: var(--ues-accent); font-size: 1rem; }
.live { display: inline-block; width: 8px; height: 8px; background: #16a34a; border-radius: 50%; margin-right: 6px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.insight { background: #fff7ef; border: 1px solid #ffd7b8; border-radius: 10px; padding: 0.7rem; margin: 0.4rem 0; font-size: 0.82rem; }
.actions { display: flex; gap: 0.4rem; margin-top: 0.8rem; flex-wrap: wrap; }
.btn {
  background: var(--ues-blue); color: #fff; border: 0; border-radius: 8px; padding: 0.45rem 0.75rem;
  cursor: pointer; font: inherit; font-size: 0.82rem; text-decoration: none;
}
.btn.ghost { background: #fff; color: var(--ues-blue); border: 1px solid var(--line); }
.btn.accent { background: var(--ues-accent); }
.office-team { display: grid; gap: 0.45rem; }
.office-team-member {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  border: 1px solid var(--line); background: #f6f8fb; border-radius: 10px; padding: 0.6rem 0.7rem;
}
.office-team-member strong { color: var(--ues-blue); font-size: 0.88rem; }
.office-team-member span { color: var(--muted); font-size: 0.78rem; text-align: right; }
.office-phone { color: var(--ues-blue); font-weight: 700; }

.modal-back {
  position: fixed; inset: 0; background: rgba(8, 18, 32, .45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal {
  background: #fff; border-radius: 16px; width: min(960px, 100%); max-height: 90vh; overflow: auto;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal header h3 { margin: 0; font-family: var(--display); color: var(--ues-blue); }
.modal .body { padding: 1.1rem; }
.report-sheet {
  max-width: 720px; margin: 0 auto; border: 1px solid var(--line); padding: 1.5rem 1.7rem;
  font-size: 0.92rem; line-height: 1.5;
}
.report-sheet h1 { font-family: var(--display); color: var(--ues-blue); font-size: 1.4rem; margin: 0 0 0.4rem; }
.boring-table, .lab-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.boring-table th, .lab-table th, .boring-table td, .lab-table td {
  border-bottom: 1px solid var(--line); text-align: left; padding: 0.4rem 0.35rem;
}
.cad-stage { background: #0b1c33; border-radius: 12px; min-height: 280px; display: flex; align-items: center; justify-content: center; }
.cloud-stage {
  height: 320px; border-radius: 12px; background: radial-gradient(circle at 30% 30%, #1b3a5f, #071422);
  position: relative; overflow: hidden;
}
.cloud-dot { position: absolute; width: 3px; height: 3px; background: #9ad0ff; border-radius: 50%; opacity: 0.8; }
.drone-stage {
  height: 320px; border-radius: 12px; background:
    linear-gradient(180deg, rgba(0,45,91,.2), rgba(0,0,0,.35)),
    url("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/16/25912/17605") center/cover;
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem;
}
.ask-fab {
  position: absolute; left: 16px; bottom: 16px; z-index: 14;
  background: var(--ues-accent); color: #fff; border: 0; border-radius: 999px;
  padding: 0.7rem 1.1rem; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 12px 28px rgba(255,109,0,.35);
}
.ask-dock {
  position: absolute; right: 16px; bottom: 16px; z-index: 14; width: min(380px, 92vw);
  background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 0.9rem;
}
.ask-dock-left { left: 16px; right: auto; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.7rem; }
.bar-row { display: grid; grid-template-columns: 1fr 90px 48px; gap: 0.4rem; align-items: center; font-size: 0.78rem; margin: 0.35rem 0; }
.bar-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row i { display: block; height: 8px; width: var(--w, 20%); background: var(--ues-blue); border-radius: 99px; }
.bar-row b { text-align: right; }
.equip-thumb {
  height: 56px; border-radius: 10px; margin-bottom: 0.45rem;
  display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(135deg, #002d5b, #004a8f);
}
.equip-thumb.agi { background: linear-gradient(135deg, #5b21b6, #7c3aed); }
.equip-thumb.humboldt { background: linear-gradient(135deg, #9a3412, #ea580c); }
.equip-thumb.geometrics { background: linear-gradient(135deg, #115e59, #0f766e); }
.equip-thumb.geotac { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.equip-thumb.custom { background: linear-gradient(135deg, #3f3f46, #71717a); }
.equip-thumb.instantel { background: linear-gradient(135deg, #7f1d1d, #b91c1c); }
.ask-dock textarea { width: 100%; min-height: 70px; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem; font: inherit; }
.cite { font-size: 0.75rem; color: var(--muted); border-left: 3px solid var(--ues-accent); padding-left: 0.5rem; margin: 0.4rem 0; }
.page { padding: 1.25rem 1.5rem; height: 100%; overflow: auto; }
.card { background: #fff; border-radius: 12px; padding: 1rem; margin-bottom: 0.8rem; box-shadow: 0 6px 18px rgba(0,20,50,.06); }
.match-path { font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; color: var(--muted); word-break: break-all; }
.score { font-weight: 700; color: var(--ues-blue); }
.pass { color: #15803d; font-weight: 700; }
.fail { color: #b91c1c; font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0 1rem; }
.chip-on { background: var(--ues-blue); color: #fff; }
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.7rem; }
.monitor-card { cursor: pointer; }
.monitor-card.selected { outline: 2px solid var(--ues-accent); }
.config-preview { max-height: 100px; overflow: auto; white-space: pre-wrap; font-size: .72rem; background: #f6f8fb; padding: .55rem; border-radius: 8px; }
.config-body { width: 100%; min-height: 180px; font: .78rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; padding: .65rem; border: 1px solid var(--line); border-radius: 8px; }
.device-detail-modal { width: min(1100px, 100%); }
.device-popup-stats { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.device-popup-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: .7rem; }
.page select, .page input[type=number] { display: block; margin: 0.3rem 0 0.7rem; padding: 0.4rem; max-width: 280px; }
.integ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem 0.85rem; margin: 0.75rem 0; }
.integ-grid label { display: grid; gap: 0.25rem; font-size: 0.75rem; color: var(--muted); }
.integ-grid input, .integ-grid select {
  font: inherit; color: var(--text); padding: 0.42rem 0.5rem;
  border: 1px solid var(--line); border-radius: 8px; width: 100%;
}
.dispatch-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0.8rem; align-items: start; }
.dispatch-stats { max-width: 960px; grid-template-columns: repeat(4, 1fr); }
.dispatch-filterbar {
  display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; padding: 0.75rem 1rem;
}
.dispatch-filterbar label { display: grid; gap: 0.2rem; min-width: 160px; font-size: 0.72rem; color: var(--muted); }
.dispatch-filterbar select { margin: 0; max-width: none; }
.dispatch-form-title { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.dispatch-form-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.dispatch-channels .layer-row { max-width: 190px; min-width: 135px; }
.dispatch-message { margin: 0.7rem 0 0; color: #166534; font-weight: 650; }
.dispatch-message.warning { color: #991b1b; }
.dispatch-alert, .dispatch-assignment-row, .dispatch-notification {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.dispatch-address { margin: 0.15rem 0 0; max-width: 190px; }
.dispatch-staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0.75rem; }
.dispatch-staff-card { display: grid; grid-template-columns: 1fr auto; gap: 0.65rem; align-items: start; margin: 0; }
.dispatch-staff-card .btn { grid-column: 1 / -1; justify-self: start; }
.dispatch-assignment-actions { display: flex; justify-content: end; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.dispatch-notification { justify-content: start; }
.dispatch-notification time { margin-left: auto; white-space: nowrap; }
.dispatch-conflict { background: #fee2e2; color: #991b1b; }
.assignment-status.status-on-site { background: #dcfce7; color: #166534; }
.assignment-status.status-complete { background: #e0e7ff; color: #3730a3; }
.assignment-status.status-cancelled { background: #f1f5f9; color: #64748b; }
.dispatch-roster .roster-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 0.45rem; align-items: center;
  padding: 0.55rem 0; border-top: 1px solid var(--line);
}
.week-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.dispatch-cal { overflow: auto; }
.dispatch-cal table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 860px; }
.dispatch-cal th, .dispatch-cal td {
  border: 1px solid #e4ebf3; padding: 0.4rem; vertical-align: top; font-size: 0.75rem;
}
.dispatch-cal thead th { background: #f6f8fb; text-align: center; color: var(--ues-blue); font-weight: 700; }
.dispatch-cal thead th span { font-weight: 500; color: var(--muted); }
.dispatch-cal tbody th { text-align: left; min-width: 150px; background: #fff; }
.dispatch-cal td { min-width: 96px; height: 72px; background: #fbfdff; }
.dispatch-cal .today { background: #fff7ef; }
.staff-chip {
  background: #e8f0f8; color: var(--ues-blue); border-radius: 8px; padding: 0.28rem 0.35rem;
  margin: 0 0 0.3rem; display: grid; grid-template-columns: 1fr auto; gap: 0 0.25rem; align-items: start;
}
.staff-chip-main {
  border: 0; background: transparent; color: inherit; padding: 0; display: grid; text-align: left;
  cursor: pointer; font: inherit;
}
.staff-chip-main small { color: var(--muted); font-size: 0.64rem; }
.staff-chip-remove {
  grid-column: 2; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.1rem;
}
.staff-chip.conflict { background: #fee2e2; color: #991b1b; }
.staff-chip.status-complete { background: #e8f5ed; color: #166534; }
.staff-chip.status-cancelled { opacity: 0.6; text-decoration: line-through; }
.site-link {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 700;
  color: var(--ues-blue); cursor: pointer; text-align: left;
}
@media (max-width: 1100px) {
  .dispatch-layout { grid-template-columns: 1fr; }
  .dispatch-form-grid { grid-template-columns: 1fr 1fr; }
  .settings-page, .page-with-nav { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .device-popup-columns { grid-template-columns: 1fr; }
  .device-popup-stats { grid-template-columns: 1fr 1fr; }
  .dispatch-stats, .dispatch-form-grid { grid-template-columns: 1fr; }
  .dispatch-alert, .dispatch-assignment-row, .dispatch-notification { align-items: start; flex-direction: column; }
  .dispatch-notification time { margin-left: 0; }
}
.login-shell {
  min-height: 100vh; display: grid; place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,109,0,.22), transparent 28rem),
    linear-gradient(145deg, #001d3b, #004a8f);
}
.login-card {
  background: #fff; width: min(420px, 92vw); border-radius: 16px;
  padding: 1.75rem 1.65rem 1.45rem; box-shadow: 0 24px 60px rgba(0,0,0,.3);
  border-top: 4px solid var(--ues-accent);
}
.login-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.35rem; color: var(--ues-blue); }
.login-brand span { font: 700 1.5rem var(--display); letter-spacing: .08em; }
.login-brand small { padding-left: .75rem; border-left: 1px solid var(--line); color: var(--muted); }
.login-card h1 { margin: 0.15rem 0 0.35rem; font-family: var(--display); color: var(--ues-blue); }
.login-card label { display: grid; gap: 0.25rem; font-size: 0.78rem; color: var(--muted); margin: 0.65rem 0; }
.login-card input {
  font: inherit; font-size: 0.95rem; color: var(--text);
  padding: 0.65rem; border: 1px solid var(--line); border-radius: 8px;
}
.login-card input:focus { outline: 2px solid rgba(0,74,143,.2); border-color: var(--ues-blue-light); }
.login-card .actions .btn { width: 100%; justify-content: center; margin-top: .35rem; padding: .65rem; }
.login-demo { display: grid; gap: .18rem; margin-top: 1.15rem; padding: .65rem .75rem; border-radius: 8px; background: #f2f6fa; color: var(--muted); font-size: .72rem; }
.login-demo strong { color: var(--ues-blue); }
.login-help { margin: .8rem 0 0; text-align: center; color: var(--muted); font-size: .7rem; }
.auth-loading { min-height: 100vh; display: grid; place-items: center; background: var(--ues-blue); color: white; font: 600 1rem var(--font); }

.gpr-viewer { border: 1px solid var(--line); background: #f8fafc; padding: .75rem; overflow-x: auto; }
.gpr-heading { display: flex; justify-content: space-between; gap: 1rem; color: var(--ues-blue); margin-bottom: .45rem; }
.gpr-heading span { color: var(--muted); font-size: .75rem; }
.gpr-viewer svg { min-width: 720px; width: 100%; height: auto; background: white; }
.gpr-interpretation { margin-top: .5rem; padding: .55rem .65rem; background: #fff7ed; border-left: 4px solid var(--ues-accent); font-size: .8rem; line-height: 1.45; }
.boring-log-sheet { width: 100%; min-width: 700px; background: white; color: #111827; border: 1px solid #111827; font: 10px Arial, sans-serif; }
.bl-header { display: grid; grid-template-columns: 1fr 150px .85fr; border-bottom: 1px solid #111827; }
.bl-header > div { display: grid; grid-template-columns: max-content 1fr; gap: 4px 8px; padding: 8px; }
.bl-header strong, .bl-header span { color: #075985; font-style: italic; }
.bl-map { width: 150px; height: 92px; border-inline: 1px solid #111827; }
.bl-body { width: 100%; height: auto; display: block; }
.bl-body text { font-family: Arial, sans-serif; }
.bl-labels { font-size: 11px; }
.bl-text { font-size: 12px; }
.bl-samples { font-size: 11px; fill: #b91c1c; font-weight: 700; }
.bl-footer { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: end; border-top: 1px solid #111827; padding: 8px 10px; font-size: 11px; }
.bl-footer > :last-child { text-align: right; }

@media print {
  .ark-header, .layer-drawer, .ask-dock, .ask-fab, .btn, .dossier-close { display: none !important; }
  .dossier { position: static; width: auto; box-shadow: none; overflow: visible; }
  #ark-map { display: none; }
  .doc-sheet { max-width: none; border: 0; box-shadow: none; padding: 0; }
  .boring-log-sheet { min-width: 0; break-inside: avoid; }
}

.designer-split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 1rem; align-items: start; }
.designer-card { margin-bottom: 0; }
.device-pane { display: block; min-height: 40vh; }
.acc-item { border-top: 1px solid var(--line); padding: 0.15rem 0; }
.acc-item:first-child { border-top: 0; }
.acc-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ues-blue);
  padding: 0.55rem 0; cursor: pointer; text-align: left;
}
.acc-head span { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.acc-body { padding: 0 0 0.7rem; }
.fee-qty, .fee-rate { max-width: 110px; }
.volume-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.45rem; margin: 0.55rem 0; }
.volume-tile {
  text-align: left; border: 1px solid var(--line); background: #f8fafc; border-radius: 10px;
  padding: 0.55rem 0.65rem; cursor: pointer; font: inherit; color: inherit;
}
.volume-tile.on { border-color: var(--ues-blue); background: #e8f0f8; }
.compact-row { border-top: 1px solid var(--line); padding: 0.4rem 0; }
.row-main {
  width: 100%; display: grid; gap: 0.1rem; border: 0; background: transparent;
  text-align: left; font: inherit; cursor: pointer; padding: 0.15rem 0;
}
.row-detail { padding: 0.45rem 0 0.2rem; }
.compact-row .actions { display: flex; align-items: center; gap: 0.35rem; }
.compact-row input { font: inherit; padding: 0.25rem 0.4rem; border: 1px solid var(--line); border-radius: 6px; }
.lab-sheet .lab-table { font-variant-numeric: tabular-nums; }
.lab-meta-table { margin-top: 0.85rem; }
.lab-meta-table th { width: 16%; white-space: nowrap; }
.lab-meta-table td { width: 34%; }
.lab-result {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 0.2rem 0.55rem;
  background: #e9eef5; color: #334155; font-size: 0.74rem; font-weight: 800; text-transform: uppercase;
}
.lab-result.pass { background: #dcfce7; color: #166534; }
.lab-result.fail { background: #fee2e2; color: #991b1b; }
.lab-result.pending { background: #fef3c7; color: #92400e; }
.lab-result.info { background: #dbeafe; color: #1e40af; }
.lab-type-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.7rem; margin-bottom: 1rem;
}
.lab-type-card {
  display: grid; gap: 0.25rem; margin: 0; text-align: left; cursor: pointer; font: inherit; color: inherit;
  border: 1px solid var(--line);
}
.lab-type-card:hover { border-color: var(--ues-blue); box-shadow: 0 8px 22px rgba(16, 55, 92, 0.1); }
.lab-package-row, .lab-throughput { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.report-equipment-picker { margin: 1rem 0; padding: 0.85rem; border: 1px solid #dce5ef; border-radius: 8px; background: #f8fafc; }
.report-device-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.45rem; margin-top: 0.6rem; }
.report-device-option { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.55rem; border: 1px solid #dce5ef; border-radius: 6px; background: white; }
.report-device-option span { display: grid; gap: 0.15rem; }
.report-device-option small { color: var(--muted); }
.report-device-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.report-device-chip { border: 1px solid #b8c9db; border-radius: 999px; padding: 0.3rem 0.65rem; color: var(--ues-blue); background: white; cursor: pointer; }
.report-equipment-table .meta { font-size: 0.72rem; }
.lab-throughput-bars { width: min(420px, 48%); }
.sf-chart-card { padding: .35rem .5rem .1rem; min-height: 240px; }
.e-control, .e-control input { font-family: var(--font) !important; }
.e-grid .e-headercell, .e-kanban .e-kanban-header .e-header-cells { color: var(--ues-blue); background: #f6f8fb; }
.e-grid .e-rowcell { padding-top: .35rem !important; padding-bottom: .35rem !important; }
.e-grid .e-row:hover .e-rowcell { background: #f3f8fc; }
.e-kanban .e-kanban-header .e-header-cells .e-header-title,
.e-kanban .e-kanban-table .e-header-cells { color: var(--ues-blue); }
.e-kanban .e-card { border-left: 3px solid var(--ues-blue) !important; }
.sf-pipeline-card .meta { margin-bottom: 0; }
.inventory-summary { grid-template-columns: repeat(4, minmax(120px, 1fr)); max-width: 1050px; }
.inventory-toolbar { display: flex; align-items: center; gap: .55rem; padding: .65rem; flex-wrap: wrap; }
.inventory-toolbar input, .inventory-toolbar select {
  margin: 0 !important; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .55rem; font: inherit;
}
.inventory-toolbar input { flex: 1 1 280px; max-width: 460px; }
.inventory-grid-shell { padding: 0; overflow: hidden; }
.inventory-equipment { display: grid; grid-template-columns: 52px 1fr; gap: .55rem; align-items: center; }
.inventory-equipment img { width: 52px; height: 42px; object-fit: cover; border-radius: 7px; background: #dbe4ef; }
.inventory-equipment small { display: block; color: var(--muted); font-size: .7rem; margin-top: .1rem; }
.inventory-inline-input { width: 100%; min-width: 120px; border: 1px solid transparent; border-radius: 6px; padding: .3rem .4rem; background: transparent; }
.inventory-inline-input:focus, .inventory-inline-input:hover { border-color: #b8c9db; background: #fff; outline: none; }
.inventory-count, .inventory-row-actions { display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
.inventory-count button, .inventory-row-actions > button:not(.btn) {
  width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ues-blue); cursor: pointer;
}
.inventory-edit { padding: .3rem .5rem; }
.inventory-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .7rem; }
.inventory-card { display: grid; grid-template-columns: 84px 1fr; gap: .65rem; padding: .7rem; margin: 0; }
.inventory-card > img { width: 84px; height: 72px; object-fit: cover; border-radius: 9px; background: #dbe4ef; }
.inventory-card .meta { margin-bottom: .2rem; }
.inventory-card-facts { grid-column: 1 / -1; display: flex; gap: .35rem; flex-wrap: wrap; }
.inventory-card-facts span { background: #f1f5f9; border-radius: 999px; padding: .2rem .45rem; font-size: .72rem; color: var(--muted); }
.inventory-row-actions { grid-column: 1 / -1; }
.inventory-row-actions input { flex: 1; min-width: 120px; padding: .35rem .45rem; border: 1px solid var(--line); border-radius: 7px; }
.weather-chip { display: inline-flex; margin-top: .2rem; padding: .2rem .45rem; border-radius: 999px; background: #e8f0f8; color: var(--ues-blue); font-size: .68rem; font-weight: 700; }
.weather-warning { background: #fff1d6 !important; color: #8a4b08 !important; }
.wx-refresh { margin-left: auto; border: 0; background: #fff; color: var(--ues-blue); border-radius: 7px; width: 30px; height: 30px; cursor: pointer; font-size: 1rem; }
@media (max-width: 1100px) {
  .designer-split { grid-template-columns: 1fr; }
  .ark-header { flex-wrap: wrap; }
  .search-cluster { max-width: none; flex-basis: 100%; order: 3; margin-left: 0; }
  .lab-package-row, .lab-throughput { align-items: stretch; flex-direction: column; }
  .lab-throughput-bars { width: 100%; }
  .inventory-summary { grid-template-columns: 1fr 1fr; }
}
