:root {
  --bg: #f4f7fb;
  --panel: #fff;
  --text: #13202f;
  --muted: #657386;
  --line: #d7e6ec;
  --brand: #087989;
  --brand2: #126bb7;
  --accent: #c66b2d;
  --ok: #148557;
  --warn: #b7791f;
  --bad: #c2413d;
  --shadow: 0 16px 40px rgba(15, 54, 72, 0.1);
  --yuanfeng-blue: #bcdded;
  --page-bg: #f4f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fbfdff 0%, var(--page-bg) 42%, #eef3f8 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

button:hover {
  border-color: #86b9bf;
  box-shadow: 0 8px 20px rgba(15, 54, 72, 0.08);
  transform: translateY(-1px);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #45a6b2;
  box-shadow: 0 0 0 3px rgba(8, 121, 137, 0.12);
  outline: none;
}

textarea {
  min-height: 84px;
  padding-top: 9px;
  resize: vertical;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

body.login-required .app {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: none;
  place-items: center end;
  padding: 36px clamp(24px, 8vw, 96px);
  position: relative;
  overflow: hidden;
}

body.login-required .login-screen {
  display: grid;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(247, 252, 255, 0.88) 54%, rgba(255, 255, 255, 0.98)),
    url("./assets/login-bg.png") center / cover no-repeat;
  transform: scale(1.01);
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(188, 221, 237, 0.9);
  box-shadow: 0 28px 80px rgba(12, 51, 82, 0.24);
  backdrop-filter: blur(14px);
}

.login-brand {
  margin-bottom: 24px;
}

.login-brand span {
  display: block;
  color: var(--brand2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.login-brand h1 {
  margin: 8px 0 6px;
  color: #083b68;
  font-size: 28px;
}

.login-brand p,
.login-help {
  color: var(--muted);
  line-height: 1.55;
}

.login-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #24465c;
  font-weight: 700;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  font-size: 16px;
}

.wecom-login-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border-color: rgba(24, 181, 107, 0.34);
  color: #096f40;
  background: linear-gradient(180deg, #f3fff8, #e4f8ee);
  font-weight: 800;
}

.wecom-login-btn:hover {
  border-color: rgba(24, 181, 107, 0.72);
  box-shadow: 0 10px 24px rgba(24, 181, 107, 0.16);
}

.login-help {
  margin: 14px 0 0;
  font-size: 12px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, #073d5e 0%, #0d5f6b 52%, #123047 100%);
  color: #e7eef4;
  overflow-y: auto;
  box-shadow: 8px 0 30px rgba(12, 43, 61, 0.14);
}

.brand {
  padding: 14px 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand b,
.brand span {
  display: block;
}

.brand b {
  font-size: 20px;
}

.brand span {
  margin-top: 6px;
  color: #9eb2c0;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

nav button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #dce7ef;
  text-align: left;
  padding: 0 14px;
  border-radius: 10px;
}

nav button.active,
nav button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: inset 3px 0 0 #7ee3f0;
  transform: none;
}

.data-tools {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.data-tools button,
.data-tools label {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 8px;
  background: #213746;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  cursor: pointer;
}

.data-tools input {
  display: none;
}

.file-button {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 22px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(199, 220, 229, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.topbar p {
  margin-bottom: 5px;
  color: var(--brand);
  font-weight: 700;
}

.user-box {
  display: grid;
  gap: 5px;
  min-width: 240px;
}

.user-stack label {
  display: grid;
  gap: 4px;
}

.user-stack select:disabled {
  color: var(--text);
  background: #f7fafc;
  opacity: 1;
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.login-row input,
.login-row button {
  min-height: 38px;
  padding: 0 10px;
}

.login-row button {
  white-space: nowrap;
}

.user-box span,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.permission-guide {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #b9e3ea;
  border-radius: 8px;
  background: #f4fdff;
}

.permission-guide-title {
  margin-bottom: 8px;
  color: #006d77;
  font-weight: 800;
}

.permission-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.permission-guide-grid div {
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid #d7e7ef;
  border-radius: 8px;
  background: #fff;
}

.permission-guide-grid b,
.permission-guide-grid span {
  display: block;
}

.permission-guide-grid b {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}

.permission-guide-grid span,
.permission-guide-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.permission-guide-note {
  margin-top: 8px;
}

.user-compact {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(120px, 0.8fr) auto auto minmax(140px, 0.9fr);
  align-items: center;
  gap: 8px;
  width: min(720px, 58vw);
  min-width: 0;
}

.user-compact select,
.user-compact input,
.user-compact button {
  min-height: 38px;
  width: 100%;
}

.user-compact button {
  width: auto;
  min-width: 64px;
  white-space: nowrap;
}

#logoutButton {
  color: #b42318;
  border-color: #fecaca;
  background: #fff7f7;
}

#logoutButton:hover {
  border-color: #fca5a5;
  background: #fff1f1;
}

.view,
.tab-panel {
  display: none;
}

.view.active,
.tab-panel.active {
  display: block;
}

body.role-maintainer #inspection .auto-sip-tip,
body.role-maintainer #inspection .compact-workflow,
body.role-maintainer #inspection .photo-upload-panel,
body.role-maintainer #inspection #saveTemplateEntry {
  display: none;
}

body.role-maintainer #inspection .inspection-workspace {
  grid-template-columns: 1fr;
}

body.role-system-staff #inspection .compact-workflow,
body.role-system-staff #inspection .photo-upload-panel,
body.role-system-staff #inspection .template-entry-ledger {
  display: none;
}

body.role-system-staff #inspection #templateBatch,
body.role-system-staff #inspection #templateInspector,
body.role-system-staff #inspection #saveTemplateEntry,
body.role-system-staff #inspection #saveCurrentAsSip,
body.role-system-staff #inspection #quickSipBar,
body.role-system-staff #inspection #advancedTools,
body.role-system-staff #inspection #toggleAdvancedTools {
  display: none;
}

body.role-system-staff #inspection .inspection-workspace {
  grid-template-columns: 1fr;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.metric,
.panel,
.phone {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(8, 121, 137, 0.1);
}

.metric span,
.metric em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.metric b {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.executive-panel {
  padding: 20px;
}

.executive-dashboard {
  display: grid;
  gap: 14px;
}

.dash-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.dash-summary article {
  min-height: 96px;
  padding: 16px;
  border: 1px solid #cae0e8;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f2fbfd 100%);
}

.dash-summary span,
.dash-summary em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.dash-summary b {
  display: block;
  margin: 8px 0 6px;
  color: #0b5563;
  font-size: 28px;
  line-height: 1;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dash-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d5e3ea;
  border-radius: 10px;
  background: #fff;
}

.dash-card h3 {
  margin: 0 0 10px;
  color: #0f2030;
  font-size: 17px;
}

.dash-wide {
  grid-column: span 2;
}

.dash-table-wrap {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dash-table th,
.dash-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e1edf2;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  word-break: break-word;
}

.dash-table th {
  color: #52677a;
  background: #f5f9fb;
  font-weight: 800;
}

.dash-table tr:last-child td {
  border-bottom: 0;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.dash-badge.ok {
  color: #057a55;
  background: #dff8eb;
}

.dash-badge.warn {
  color: #9a5b00;
  background: #fff1c2;
}

.dash-badge.danger {
  color: #b42318;
  background: #ffe3df;
}

.dash-rank-row,
.dash-status-row {
  display: grid;
  grid-template-columns: 28px minmax(80px, 1fr) minmax(90px, 1.2fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eef4f7;
  font-size: 13px;
}

.dash-status-row {
  grid-template-columns: minmax(100px, 1fr) minmax(130px, 1.4fr) 32px;
}

.dash-rank-row:last-child,
.dash-status-row:last-child {
  border-bottom: 0;
}

.dash-rank-row b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: #0f6b75;
  font-size: 12px;
}

.dash-rank-row span,
.dash-status-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-rank-row em {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

.dash-bar {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f6;
}

.dash-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.dash-blue i {
  background: linear-gradient(90deg, #1486c8, #25b7c8);
}

.dash-amber i {
  background: linear-gradient(90deg, #f59e0b, #facc15);
}

.dash-red i {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.dash-green i {
  background: linear-gradient(90deg, #10b981, #22c55e);
}

.dash-summary-text {
  padding: 12px 14px;
  border: 1px solid #bee3ea;
  border-left: 5px solid #0f7f8c;
  border-radius: 10px;
  background: #f2fbfd;
  color: #274256;
  line-height: 1.7;
}

.production-screen-panel {
  padding: 18px;
}

.production-screen {
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(53, 217, 255, 0.38);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 38%, rgba(28, 121, 255, 0.28), transparent 34%),
    linear-gradient(135deg, #081936 0%, #0a2856 48%, #071a3a 100%);
  color: #e8f7ff;
  box-shadow: inset 0 0 0 1px rgba(120, 218, 255, 0.12), 0 16px 34px rgba(0, 32, 70, 0.18);
}

.screen-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px 10px;
  border-bottom: 1px solid rgba(88, 207, 255, 0.24);
}

.screen-topbar span,
.screen-topbar em {
  color: #9edfff;
  font-style: normal;
  font-size: 13px;
}

.screen-topbar strong {
  color: #fff;
  font-size: 24px;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(53, 217, 255, 0.82);
}

.screen-topbar em {
  justify-self: end;
}

.screen-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.screen-kpi {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(68, 208, 255, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 70, 147, 0.88), rgba(7, 32, 83, 0.9));
  box-shadow: inset 0 0 18px rgba(53, 217, 255, 0.1);
}

.screen-kpi span,
.screen-kpi em {
  display: block;
  overflow: hidden;
  color: #a6dfff;
  font-style: normal;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-kpi b {
  display: block;
  margin: 5px 0;
  color: #35d9ff;
  font-size: 25px;
  line-height: 1.1;
}

.screen-green b {
  color: #3ddc97;
}

.screen-pink b {
  color: #ff6bb6;
}

.screen-amber b {
  color: #ffca3a;
}

.screen-red b {
  color: #ff5b6e;
}

.screen-violet b {
  color: #b9a5ff;
}

.screen-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(300px, 1fr) minmax(280px, 1.1fr);
  gap: 12px;
}

.screen-card,
.screen-stage,
.screen-table-wrap {
  min-width: 0;
  border: 1px solid rgba(65, 197, 255, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 47, 105, 0.9), rgba(7, 30, 78, 0.9));
  box-shadow: inset 0 0 22px rgba(50, 202, 255, 0.1);
}

.screen-card {
  padding: 12px;
}

.screen-card h3,
.screen-table-wrap h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.screen-card-tall {
  min-height: 250px;
}

.screen-legend {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  color: #c6edff;
  font-size: 12px;
}

.screen-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.screen-good-dot,
.screen-bad-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.screen-good-dot {
  background: #35d9ff;
}

.screen-bad-dot {
  background: #ff6bb6;
}

.screen-trend {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 8px;
  min-height: 186px;
  padding: 8px 0 0;
}

.screen-trend-item {
  display: grid;
  align-items: end;
  gap: 7px;
  min-width: 0;
  height: 100%;
}

.screen-trend-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  height: 150px;
  border-bottom: 1px solid rgba(166, 223, 255, 0.35);
}

.screen-trend-bars i {
  width: 13px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.screen-good-bar {
  background: linear-gradient(180deg, #74f1ff, #1174ff);
  box-shadow: 0 0 10px rgba(53, 217, 255, 0.45);
}

.screen-bad-bar {
  background: linear-gradient(180deg, #ff8ac9, #f43f5e);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.42);
}

.screen-trend-item b {
  color: #b9dcff;
  font-size: 11px;
  text-align: center;
}

.screen-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 16px;
}

.screen-stage-glow {
  position: absolute;
  inset: 18px;
  border-radius: 14px;
  background: radial-gradient(circle, rgba(53, 217, 255, 0.36), transparent 64%);
  filter: blur(2px);
}

.screen-stage-title {
  position: relative;
  z-index: 1;
  align-self: start;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(53, 217, 255, 0.9);
}

.screen-factory {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 42px);
  align-items: end;
  gap: 7px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(116, 241, 255, 0.38);
  transform: perspective(500px) rotateX(14deg);
  background: linear-gradient(180deg, rgba(27, 112, 210, 0.34), rgba(5, 21, 62, 0.72));
  box-shadow: 0 0 24px rgba(53, 217, 255, 0.24), inset 0 -12px 18px rgba(53, 217, 255, 0.12);
}

.screen-factory i {
  display: block;
  width: 42px;
  border: 1px solid rgba(116, 241, 255, 0.55);
  background: linear-gradient(180deg, rgba(94, 213, 255, 0.5), rgba(19, 90, 201, 0.2));
}

.screen-factory i:nth-child(1) { height: 54px; }
.screen-factory i:nth-child(2) { height: 82px; }
.screen-factory i:nth-child(3) { height: 68px; }
.screen-factory i:nth-child(4) { height: 96px; }

.screen-stage-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.screen-stage-foot span {
  padding: 4px 9px;
  border: 1px solid rgba(53, 217, 255, 0.38);
  border-radius: 999px;
  color: #c9f1ff;
  background: rgba(15, 76, 145, 0.54);
  font-size: 12px;
}

.screen-donut-wrap {
  display: grid;
  grid-template-columns: 142px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 190px;
}

.screen-donut {
  width: 142px;
  height: 142px;
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(53, 217, 255, 0.32);
}

.screen-donut::after {
  content: "";
  display: block;
  width: 74px;
  height: 74px;
  margin: 34px;
  border-radius: 50%;
  background: #08224b;
  box-shadow: inset 0 0 12px rgba(53, 217, 255, 0.28);
}

.screen-donut-wrap ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.screen-donut-wrap li {
  display: grid;
  grid-template-columns: 10px minmax(70px, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #d9f4ff;
  font-size: 12px;
}

.screen-donut-wrap li i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.screen-rank-row {
  display: grid;
  grid-template-columns: 24px minmax(80px, 1fr) minmax(90px, 1.2fr) 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(157, 218, 255, 0.16);
}

.screen-rank-row:last-child {
  border-bottom: 0;
}

.screen-rank-row b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #061832;
  background: #35d9ff;
  font-size: 12px;
}

.screen-rank-row span {
  overflow: hidden;
  color: #eaf9ff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-rank-row strong {
  color: #fff;
  font-size: 13px;
  text-align: right;
}

.screen-rank-bar {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(180, 224, 255, 0.12);
}

.screen-rank-bar em {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.screen-rank-cyan em {
  background: linear-gradient(90deg, #1d8dff, #35d9ff);
}

.screen-rank-amber em {
  background: linear-gradient(90deg, #ff9f1c, #ffca3a);
}

.screen-rank-red em {
  background: linear-gradient(90deg, #ff4d6d, #ff9f1c);
}

.screen-empty {
  color: #a6dfff;
  font-size: 13px;
}

.screen-table-wrap {
  margin-top: 12px;
  padding: 12px;
}

.screen-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.screen-table th,
.screen-table td {
  padding: 8px 9px;
  border: 1px solid rgba(105, 197, 255, 0.22);
  color: #eaf9ff;
  font-size: 12px;
  text-align: left;
  word-break: break-word;
}

.screen-table th {
  color: #aeeaff;
  background: rgba(18, 95, 179, 0.42);
  font-weight: 800;
}

.screen-table td:nth-child(6) {
  color: #ff6bb6;
  font-weight: 800;
}

.panel {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  margin-bottom: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.danger {
  background: #fff1f0;
  color: var(--bad);
  border-color: #f2b8b5;
}

.ok-btn {
  background: #eef9f3;
  color: var(--ok);
  border-color: #a9dbc4;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab.active {
  background: #e6f5f3;
  color: var(--brand);
  border-color: #8bc6bf;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.form-grid textarea {
  grid-column: 1 / -1;
}

.form-grid button {
  min-height: 40px;
}

.inspection-timing-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto auto repeat(4, minmax(150px, 1fr));
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid #a9d6dc;
  border-radius: 8px;
  background: #f0fbfc;
}

.inspection-timing-bar b {
  color: #087989;
  white-space: nowrap;
  align-self: center;
}

.inspection-timing-bar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inspection-timing-bar input,
.inspection-timing-bar button {
  min-height: 36px;
}

.inspection-timing-bar input.timing-readonly {
  background: #eef6f8;
  color: #64748b;
  cursor: not-allowed;
}

.report-warning-timing {
  margin-bottom: 12px;
}

.inspection-countdown {
  grid-column: 1 / -1;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.inspection-countdown.countdown-safe,
.inspection-countdown.countdown-done {
  border-color: #22c55e;
  background: #dcfce7;
  color: #047857;
}

.inspection-countdown.countdown-warn {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #b45309;
  animation: countdownPulse 1.2s ease-in-out infinite;
}

.inspection-countdown.countdown-danger {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
  animation: countdownPulse 0.8s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
}

.inspection-timing-bar span {
  grid-column: 1 / -1;
  color: #526b7d;
  font-size: 12px;
}

.inspection-workspace {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 12px;
}

.inspection-workspace > * {
  min-width: 0;
}

.workflow-card {
  padding: 12px;
  border: 1px solid #c9dbe2;
  border-radius: 8px;
  background: #fff;
}

.workflow-card-main {
  background: #fbfdfe;
}

.workflow-card-maintain {
  background: #f3fbfc;
  border-color: #9fcbd2;
}

.workflow-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.workflow-title b {
  color: var(--brand);
  font-size: 16px;
}

.workflow-title span {
  color: var(--muted);
  font-size: 13px;
}

.inspection-entry-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.inspection-module-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.inspection-module-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.inspection-module-tabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.module-project-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #b7dce2;
  border-radius: 8px;
  background: #f3fbfc;
}

.module-project-panel b {
  margin-right: 4px;
}

.module-project-panel span {
  padding: 5px 8px;
  border: 1px solid #cfe0e5;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.quick-add-panel {
  display: none;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px dashed #8bbec4;
  border-radius: 8px;
  background: #f3fbfb;
}

.quick-add-panel.open {
  display: block;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.chip button {
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--bad);
}

.table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), minmax(90px, 1fr));
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
}

.row:last-child {
  border-bottom: 0;
}

.head {
  background: #f5f8fb;
  color: var(--muted);
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.table-inline-input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.template-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-actions select {
  min-width: 260px;
}

.sip-wizard {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #b8d9de;
  border-radius: 8px;
  background: #f3fbfc;
}

.sip-step {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sip-step b {
  color: var(--brand);
  font-size: 14px;
}

.sip-step input,
.sip-step select {
  width: 100%;
  min-height: 40px;
}

.sip-wizard > button {
  min-height: 42px;
}

.auto-sip-tip {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #b8d9de;
  border-radius: 8px;
  background: #f3fbfc;
  color: #31536a;
  line-height: 1.5;
}

.auto-sip-tip b {
  color: var(--brand);
}

.auto-sip-tip span {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  border: 1px solid #cfe0e6;
}

.quick-sip-bar {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(130px, 170px) auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
  padding: 0;
  border: 1px solid #9fcbd2;
  border-radius: 0;
  border-width: 0;
  background: transparent;
  color: #31536a;
}

.quick-sip-bar b {
  color: var(--brand);
}

.quick-sip-bar input {
  width: 100%;
  min-height: 38px;
}

.quick-sip-bar button {
  min-height: 38px;
  white-space: nowrap;
}

.advanced-tools {
  display: none;
  margin-bottom: 10px;
}

.advanced-tools.open {
  display: block;
}

.template-maintenance {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px dashed #99c3c8;
  border-radius: 8px;
  background: #f4fbfb;
}

.template-fill-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.template-fill-meta select,
.template-fill-meta .primary {
  grid-column: span 2;
}

.report-type-maintenance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -2px 0 12px;
  padding: 10px 12px;
  border: 1px dashed #7fb7c4;
  border-radius: 8px;
  background: #f2fbfc;
  color: #38566b;
}

.report-type-maintenance span {
  font-weight: 800;
}

.report-type-maintenance input {
  min-width: 230px;
  flex: 1 1 260px;
}

.report-type-maintenance select {
  min-width: 220px;
}

.permission-tip {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7fafc;
  color: var(--muted);
  border: 1px solid var(--line);
}

.bluetooth-measure-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) 150px minmax(260px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #9ac8cf;
  border-radius: 8px;
  background: #eef9f8;
}

.bluetooth-measure-panel b,
.bluetooth-measure-panel span {
  display: block;
}

.bluetooth-measure-panel > div > span {
  color: var(--muted);
  font-size: 13px;
}

.bt-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bt-result span {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.bt-result b {
  margin-top: 4px;
  color: var(--text);
}

.dimension-check-wrap {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.photo-upload-panel {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.photo-upload-form {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) minmax(220px, 1fr) auto;
  margin-bottom: 12px;
}

.photo-upload-form input[type="file"] {
  padding: 10px;
  background: #fff;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.photo-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid #cfe0e8;
  border-radius: 8px;
  background: #f8fbfd;
}

.photo-card img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border: 1px solid #cfe0e8;
  border-radius: 6px;
  background: #fff;
}

.photo-card b,
.photo-card span,
.photo-card p {
  display: block;
  margin: 0 0 4px;
  word-break: break-word;
}

.photo-card span,
.photo-card p {
  color: var(--muted);
  font-size: 12px;
}

.photo-card button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.resident-record-grid {
  display: grid;
  gap: 12px;
}

.resident-card,
.resident-report-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.resident-card {
  grid-template-columns: 140px minmax(0, 1fr);
}

.resident-card img {
  width: 140px;
  height: 104px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef3f8;
}

.resident-card b,
.resident-report-card b {
  display: block;
  margin-bottom: 6px;
  color: #082f49;
}

.resident-card span,
.resident-report-card span,
.resident-card p,
.resident-report-card p {
  display: block;
  margin: 3px 0;
  color: var(--muted);
  line-height: 1.45;
}

.resident-defect-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cfe0e6;
  border-radius: 8px;
  background: #f7fcfd;
}

.resident-defect-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.resident-defect-head b {
  color: var(--text);
}

.resident-defect-head span {
  color: var(--muted);
  font-size: 13px;
}

.resident-defect-rows {
  display: grid;
  gap: 6px;
}

.resident-defect-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.6fr) minmax(150px, 1.2fr) minmax(130px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.resident-defect-row input,
.resident-defect-row select,
.resident-defect-row button {
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.file-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px dashed #7eb3bd;
  border-radius: 8px;
  background: #f4fbfc;
  color: #0b6b78;
  font-weight: 700;
  cursor: pointer;
}

.file-box input {
  display: none;
}

.resident-analysis {
  display: grid;
  gap: 14px;
}

.resident-summary {
  padding: 12px 14px;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #f4fbfc;
  color: #123247;
  line-height: 1.65;
}

.resident-bar {
  display: grid;
  grid-template-columns: 130px minmax(120px, 1fr) 86px;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.resident-bar span,
.resident-bar b {
  font-size: 13px;
}

.resident-bar div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.resident-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
}

.resident-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.resident-analysis-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.resident-analysis-card h3 {
  margin: 0 0 8px;
}

.template-evidence-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  padding: 3px 6px;
  border: 1px solid #9ac8cf;
  border-radius: 6px;
  background: #f6fbfc;
  font-size: 12px;
  white-space: nowrap;
}

.row-evidence-box {
  margin-top: 4px;
  padding: 5px;
  border: 1px dashed #8bbcc3;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
}

.row-evidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}

.evidence-upload-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #9ac8cf;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.evidence-upload-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.row-evidence-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.row-evidence-thumbs img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid #9ac8cf;
  border-radius: 4px;
  background: #fff;
}

.compact-head {
  margin-bottom: 8px;
}

.inspection-header-info {
  overflow: hidden;
  margin-bottom: 10px;
}

.inspection-header-info table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.inspection-header-info th,
.inspection-header-info td {
  border: 1px solid #111;
  height: 38px;
  padding: 0 4px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.inspection-header-info th {
  width: 120px;
  background: #f7fafc;
  font-weight: 700;
}

.inspection-header-info input {
  width: 100%;
  min-height: 36px;
  border: 1px solid transparent;
  padding: 0 8px;
  text-align: center;
  box-sizing: border-box;
  font: inherit;
  background: transparent;
}

.inspection-header-info input:focus {
  border-color: var(--brand);
  background: #fff;
  outline: none;
}

.inspection-column-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) auto minmax(180px, 260px) auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px dashed #92bfc5;
  border-radius: 8px;
  background: #f6fbfc;
}

.inspection-column-tools.hidden {
  display: none;
}

.first-article-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) repeat(3, minmax(140px, 1fr)) auto minmax(180px, 260px) auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px dashed #92bfc5;
  border-radius: 8px;
  background: #f6fbfc;
}

.first-article-tools input,
.first-article-tools select {
  min-height: 38px;
}

.first-article-wrap.hidden,
.general-inspection-tables.hidden,
.function-reliability-tables.hidden,
#dimensionCheckTableWrap.hidden {
  display: none;
}

.first-article-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0;
  background: #cfead2;
}

.first-article-table th,
.first-article-table td {
  border: 1px solid #111;
  min-height: 34px;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  line-height: 1.25;
  word-break: break-word;
}

.first-article-table th {
  background: #dbe5f3;
  font-weight: 800;
}

.first-article-table td {
  background: #cfead2;
}

.first-article-table tr:nth-child(even) td {
  background: #e8eef5;
}

.first-article-table .first-title {
  background: #0b75bb;
  color: #fff;
  font-size: 16px;
  height: 28px;
}

.print-first-article-table {
  min-width: 1120px;
  margin-top: 10px;
}

.print-first-article-table .fa-label-col {
  width: 92px;
}

.print-first-article-table .fa-value-col {
  width: 180px;
}

.print-first-article-table .fa-label-wide {
  width: 170px;
}

.print-first-article-table .fa-value-wide {
  width: 290px;
}

.print-first-article-table .fa-small-col {
  width: 84px;
}

.print-first-article-table .blank-row {
  height: 20px;
  background: #cfead2;
}

.print-first-article-table textarea {
  min-height: 68px;
}

.print-first-article-table td:last-child textarea {
  min-height: 38px;
}

.first-article-table .first-article-long-note {
  min-height: 76px;
}

.first-article-table .first-abnormal-title {
  height: 28px;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.first-article-table .first-abnormal-row th {
  background: #dbe5f3;
  font-weight: 900;
}

.first-article-table .first-abnormal-row textarea {
  display: block;
  width: 100%;
  min-height: 62px;
  padding: 6px 8px;
  text-align: left;
  background: transparent;
}

.first-article-table .first-footer-row th,
.first-article-table .first-footer-row td {
  height: 48px;
  min-height: 48px;
  background: #cfead2 !important;
}

.first-article-table .first-footer-row textarea {
  min-height: 46px;
  background: transparent;
}

.first-article-table .first-footer-row .first-reason-buttons {
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 6px;
  height: 100%;
  align-items: center;
}

.first-article-table .first-footer-row .first-reason-buttons label {
  min-height: 28px;
  padding: 3px 8px;
  white-space: nowrap;
}

.first-article-table .first-footer-spacer td {
  height: 14px;
  min-height: 14px;
  background: #cfead2 !important;
  padding: 0;
}

/* Compact inspection report layout for A4 printing and dense on-screen editing. */
.inspection-workspace .first-article-table,
.inspection-workspace .incoming-report-table,
.inspection-workspace .high-pressure-patrol-table {
  font-size: 13px;
}

.inspection-workspace .first-article-table th,
.inspection-workspace .first-article-table td {
  min-height: 24px;
  height: auto;
  padding: 0;
  line-height: 1.12;
}

.inspection-workspace .first-article-table input,
.inspection-workspace .first-article-table select,
.inspection-workspace .first-article-table textarea,
.inspection-workspace .incoming-report-table input,
.inspection-workspace .incoming-report-table select,
.inspection-workspace .incoming-report-table textarea,
.inspection-workspace .high-pressure-patrol-table input,
.inspection-workspace .high-pressure-patrol-table select,
.inspection-workspace .high-pressure-patrol-table textarea {
  min-height: 22px;
  height: 22px;
  padding: 1px 4px;
  font-size: 12px;
  line-height: 1.15;
  border-radius: 3px;
}

.inspection-workspace .first-article-table textarea,
.inspection-workspace .incoming-report-table textarea,
.inspection-workspace .high-pressure-patrol-table textarea {
  min-height: 34px;
  height: 34px;
  resize: vertical;
}

.inspection-workspace .process-confirm-row td {
  height: 58px;
  min-height: 58px;
}

.inspection-workspace .process-confirm-row textarea {
  min-height: 42px;
  height: 42px;
}

.inspection-workspace .process-confirm-row td:nth-child(4) textarea {
  min-height: 42px;
  height: 42px;
}

.inspection-workspace .template-evidence-toggle {
  margin: 0 0 2px;
  padding: 1px 4px;
  font-size: 11px;
  line-height: 1.1;
}

.inspection-workspace .row-evidence-box {
  margin-top: 2px;
  padding: 2px 3px;
  border-radius: 4px;
}

.inspection-workspace .row-evidence-head {
  gap: 3px;
  margin-bottom: 2px;
  font-size: 11px;
  line-height: 1.1;
}

.inspection-workspace .evidence-upload-btn {
  min-height: 20px;
  padding: 1px 5px;
  font-size: 11px;
  border-radius: 4px;
}

.inspection-workspace .row-evidence-thumbs {
  gap: 2px;
}

.inspection-workspace .row-evidence-thumbs img {
  width: 22px;
  height: 22px;
}

.inspection-workspace .first-reason-buttons {
  gap: 4px;
}

.inspection-workspace .first-reason-buttons label,
.inspection-workspace .first-article-table label {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1.1;
}

.inspection-workspace .first-article-table .first-title {
  height: 24px;
  font-size: 14px;
}

.inspection-workspace .first-article-table .sub-title,
.inspection-workspace .first-article-table .section-title,
.inspection-workspace .first-article-table .process-sub-title {
  height: 22px;
  min-height: 22px;
  font-size: 13px;
  line-height: 1.1;
}

.first-template-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px dashed #7fb7c4;
  border-radius: 8px;
  background: #f2fbfc;
  color: #38566b;
}

.first-template-tools span {
  margin-right: auto;
}

.first-template-tools button,
.row-delete-btn {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 7px;
}

.row-delete-btn {
  display: block;
  width: max-content;
  margin: 6px auto 0;
  font-size: 12px;
}

.incoming-report-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #cfead2;
  border: 2px solid #0c63b7;
  margin-top: 10px;
}

.incoming-report-table th,
.incoming-report-table td {
  border: 1px solid #111;
  padding: 0;
  min-height: 34px;
  height: 38px;
  text-align: center;
  vertical-align: middle;
  color: #111;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.incoming-report-table th {
  font-weight: 800;
  background: #cfead2;
}

.incoming-report-table .incoming-title {
  font-size: 22px;
  height: 34px;
  letter-spacing: 0;
}

.high-pressure-patrol-table {
  border-color: #0f8f60;
  font-size: 11px;
}

.high-pressure-patrol-table .incoming-title {
  background: #073f72;
  color: #fff;
  font-size: 20px;
  height: 38px;
}

.high-pressure-patrol-table .incoming-title .template-title-input {
  min-height: 38px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.high-pressure-patrol-table .incoming-title .template-title-input:disabled {
  opacity: 1;
  cursor: default;
}

.high-pressure-patrol-table .section-row th {
  background: #dbe5f3;
  height: 24px;
  font-weight: 900;
}

.high-pressure-patrol-table textarea {
  min-height: 36px;
  line-height: 1.2;
}

.high-pressure-patrol-table .first-reason-buttons {
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 2px;
}

.high-pressure-patrol-table .first-reason-buttons label {
  min-height: 22px;
  padding: 1px 5px;
  white-space: nowrap;
}

.patrol-time-cell input {
  display: inline-block;
  width: 34px !important;
  min-height: 24px;
  padding: 1px 2px;
}

.patrol-time-cell {
  white-space: nowrap !important;
  word-break: keep-all !important;
  text-align: center !important;
  font-size: 11px;
}

.patrol-note {
  text-align: left !important;
  padding: 4px 8px !important;
  font-size: 11px;
}

.incoming-report-table .incoming-side-title {
  width: 34px;
  writing-mode: vertical-rl;
  letter-spacing: 0;
  font-weight: 800;
}

.incoming-report-table input,
.incoming-report-table textarea {
  width: 100%;
  min-height: 34px;
  border: 0;
  padding: 5px 6px;
  background: transparent;
  text-align: center;
  font: inherit;
  box-sizing: border-box;
  resize: vertical;
}

.incoming-report-table textarea {
  min-height: 54px;
  text-align: left;
}

.incoming-report-table .dimension-limit-row td {
  height: 64px;
  min-height: 64px;
  overflow: hidden;
}

.incoming-report-table .dimension-limit-row input,
.incoming-report-table .dimension-limit-row textarea {
  min-height: 44px;
  padding: 2px 3px;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: clip;
}

.incoming-report-table .dimension-item-cell input,
.incoming-report-table .dimension-tool-cell input,
.incoming-report-table .dimension-limit-cell input {
  white-space: nowrap;
}

.incoming-report-table .dimension-standard-cell input,
.incoming-report-table .dimension-standard-cell textarea {
  font-size: 12px;
  text-align: left;
}

.incoming-report-table .dimension-limit-cell {
  width: 48px;
}

.incoming-report-table .dimension-tool-cell {
  min-width: 64px;
  font-size: 12px;
}

.incoming-report-table .dimension-judge-cell .first-reason-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  padding: 3px;
}

.incoming-report-table .dimension-judge-cell .first-reason-buttons label {
  width: 100%;
  min-height: 24px;
  padding: 1px 4px;
  font-size: 12px;
  gap: 2px;
  white-space: nowrap;
  justify-content: center;
  box-sizing: border-box;
}

.incoming-report-table .dimension-judge-cell .first-reason-buttons input {
  width: 12px;
  height: 12px;
}

.dimension-inline-actuals {
  display: grid;
  grid-template-columns: repeat(5, minmax(26px, 1fr));
  align-items: stretch;
  min-height: 36px;
}

.dimension-inline-actuals input {
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 36px;
  border-right: 1px solid #111;
  border-radius: 0;
  background: #f8fbff;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  padding: 0 2px;
  cursor: text;
  caret-color: #087f9b;
}

.dimension-inline-actuals input:focus {
  background: #ffffff;
  outline: 1px solid #087f9b;
  outline-offset: -1px;
}

.dimension-inline-actuals input:last-child {
  border-right: 0;
}

.dimension-actual-input.dimension-out-of-spec,
.dimension-inline-actuals .dimension-out-of-spec {
  color: #dc2626;
  font-weight: 900;
  background: #fff1f2;
}

.incoming-report-table .date-part {
  width: 56px;
}

.incoming-options {
  text-align: left;
}

.incoming-options .first-reason-buttons {
  display: inline-flex;
  margin-left: 8px;
}

.incoming-final-row th,
.incoming-final-row td {
  min-height: 48px;
  height: 48px;
}

.incoming-final-options {
  text-align: left;
  padding-left: 10px !important;
}

.incoming-final-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 18px;
}

.incoming-final-options strong {
  display: inline-block;
  min-width: 72px;
  color: #087f5b;
}

.incoming-final-options .danger-text {
  color: #c92a2a;
}

.incoming-mrb-title {
  height: 30px;
  padding-left: 8px !important;
  text-align: left !important;
  font-weight: 800;
}

.incoming-report-table td textarea[name^="mrbOpinion"] {
  min-height: 44px;
}

.first-article-table .section-title {
  background: #dfe8f6;
  height: 24px;
  line-height: 1.2;
}

.first-article-table .sub-title {
  background: #f3dfcf;
  height: 24px;
  line-height: 1.2;
}

.first-article-table .editable-title-cell {
  padding: 1px 4px;
}

.first-article-table .template-title-input {
  min-height: 20px;
  height: 22px;
  padding: 0 4px;
  font-weight: 900;
  background: transparent;
  color: inherit;
}

.first-article-table .section-title .template-title-input,
.first-article-table .sub-title .template-title-input {
  font-size: 13px;
  line-height: 1.2;
}

.first-article-table .template-title-input:disabled {
  opacity: 1;
  cursor: default;
}

.first-article-table input,
.first-article-table select,
.first-article-table textarea {
  width: 100%;
  min-height: 34px;
  border: 0;
  padding: 4px 6px;
  text-align: center;
  background: transparent;
  font: inherit;
  box-sizing: border-box;
  resize: vertical;
}

.first-article-table textarea {
  min-height: 54px;
  text-align: left;
}

.first-article-table .process-confirm-row td,
.first-article-table .process-confirm-row th {
  height: 78px;
  min-height: 78px;
  padding: 0;
  font-size: 12px;
  line-height: 1.18;
}

.first-article-table .process-confirm-row textarea {
  min-height: 38px;
  max-height: 52px;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1.18;
  resize: none;
  overflow: auto;
}

.first-article-table .process-confirm-row .first-reason-buttons {
  gap: 4px;
  padding: 2px;
}

.first-article-table .process-confirm-row .first-reason-buttons label {
  min-height: 24px;
  padding: 2px 6px;
  font-size: 12px;
}

.first-article-table .process-confirm-row .template-evidence-toggle {
  margin-bottom: 2px;
  padding: 1px 5px;
  font-size: 11px;
}

.first-article-table .process-confirm-row .row-evidence-box {
  margin-top: 2px;
  padding: 3px;
}

.first-article-table .process-confirm-row .row-evidence-head {
  gap: 4px;
  margin-bottom: 2px;
  font-size: 11px;
}

.first-article-table .process-confirm-row .evidence-upload-btn {
  min-height: 22px;
  padding: 1px 6px;
  font-size: 11px;
}

.first-article-table .process-confirm-row .row-evidence-thumbs img {
  width: 24px;
  height: 24px;
}

.first-article-table .first-dimension-mini-cell {
  padding: 0;
}

.first-article-table .first-dimension-group-title th {
  height: 30px;
  background: #d7efe0;
  color: #0f3d36;
  font-weight: 900;
  letter-spacing: 0;
  border-top: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  position: relative;
}

.first-article-table .first-dimension-group-title .dimension-add-row-btn {
  position: absolute;
  right: 8px;
  top: 3px;
  min-height: 24px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
}

.first-article-table .process-addable-title th,
.first-article-table th.process-addable-title {
  position: relative;
}

.process-add-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.process-add-dimension-select {
  min-height: 24px;
  height: 24px;
  min-width: 82px;
  padding: 1px 20px 1px 6px;
  font-size: 12px;
  font-weight: 700;
}

.first-article-table .process-addable-title .process-add-control {
  position: absolute;
  right: 8px;
  top: 3px;
}

.first-article-table .process-addable-title .process-add-row-btn {
  min-height: 24px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
}

.first-article-table .first-dimension-result-row > td {
  background: #dff2e4;
}

.first-dimension-mini-table {
  width: 100%;
  height: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 0;
}

.first-dimension-mini-table th,
.first-dimension-mini-table td {
  border: 0;
  border-right: 1px solid #1f2937;
  border-bottom: 1px solid #1f2937;
  padding: 0;
  background: #d9f0dd;
  vertical-align: middle;
  box-shadow: none;
  filter: none;
}

.first-dimension-mini-table tr > *:last-child {
  border-right: 0;
}

.first-dimension-mini-table tr:last-child > * {
  border-bottom: 0;
}

.first-dimension-mini-table .dimension-mini-standard-col {
  width: 26%;
}

.first-dimension-mini-table .dimension-mini-limit-col {
  width: 12%;
}

.first-dimension-mini-table .dimension-mini-actual-col {
  width: 10%;
}

.first-dimension-mini-table .dimension-mini-title {
  font-weight: 800;
  line-height: 1.25;
  background: #c7e8cf;
  border-bottom: 0;
}

.first-dimension-mini-table .dimension-mini-title span {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.first-dimension-mini-table .dimension-standard-head,
.first-dimension-mini-table .dimension-limit-head,
.first-dimension-mini-table .dimension-actual-head {
  height: 24px;
  background: #c7e8cf;
  font-weight: 900;
}

.first-dimension-mini-table .dimension-standard-cell {
  background: #eef8f0;
  border-bottom: 0;
}

.first-dimension-mini-table textarea,
.first-dimension-mini-table input {
  min-height: 30px;
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-box-shadow: none;
  filter: none;
  outline: none;
  padding: 2px 4px;
  font-size: 13px;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
}

.first-dimension-mini-table textarea:focus,
.first-dimension-mini-table input:focus,
.first-dimension-mini-table .dimension-actual-input:focus {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
  filter: none !important;
}

.first-dimension-mini-table textarea {
  min-height: 54px;
  max-height: 64px;
  text-align: left;
  resize: none;
  overflow: auto;
}

.first-dimension-mini-table .dimension-actual-input {
  text-align: center;
  font-weight: 700;
  min-height: 34px;
  font-size: 15px;
  border-radius: 0;
  background: #f8fbff;
  cursor: text;
  color: #0f172a;
  caret-color: #087f9b;
}

.first-dimension-mini-table .dimension-actual-input:focus {
  background: #ffffff !important;
  outline: 1px solid #087f9b !important;
  outline-offset: -1px !important;
}

.first-dimension-mini-table .dimension-out-of-spec {
  color: #dc2626;
  font-weight: 900;
  background: #fff1f2;
}

.first-article-table .locked-template {
  color: #243447;
}

.first-article-table .process-dimension-text {
  width: 100%;
  min-width: 76px;
  height: 28px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.first-article-table .locked-template:disabled {
  cursor: not-allowed;
}

.first-reason-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  padding: 5px 6px;
  min-height: 34px;
}

.first-reason-buttons label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #8db6c0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}

.first-reason-buttons input {
  width: auto;
  min-height: 0;
  margin: 0;
  accent-color: #0f7f8c;
}

.first-reason-buttons label:has(input:checked) {
  border-color: #0f7f8c;
  background: #e8f7f5;
  color: #0b6872;
  font-weight: 800;
}

.inspection-column-tools input,
.inspection-column-tools select {
  min-height: 38px;
}

.general-inspection-tables,
.function-reliability-tables {
  display: grid;
  gap: 0;
  margin-bottom: 0;
  width: 100%;
  overflow: hidden;
}

.general-check-table,
.test-check-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  margin: 0;
}

.general-check-table th,
.general-check-table td,
.test-check-table th,
.test-check-table td {
  border: 1px solid #111;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  color: #111;
  height: 42px;
  line-height: 1.35;
  box-sizing: border-box;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}

.general-check-table th,
.test-check-table th {
  background: #f7fafc;
  font-weight: 700;
}

.general-check-table .general-title,
.test-check-table .general-title {
  width: 52px;
  writing-mode: vertical-rl;
  letter-spacing: 0;
  background: #fff;
  font-weight: 700;
}

.general-check-table .seq-col,
.test-check-table .seq-col {
  width: 54px;
}

.general-check-table .v-col,
.test-check-table .v-col {
  width: 52px;
}

.general-check-table .item-col {
  width: 220px;
}

.general-check-table .standard-col {
  width: 210px;
}

.general-check-table .result-col {
  width: 180px;
}

.general-check-table .judge-col {
  width: 130px;
}

.general-check-table .remark-col {
  width: 140px;
}

.test-check-table .test-item-col {
  width: 190px;
}

.test-check-table .device-col {
  width: 180px;
}

.test-check-table .qty-col {
  width: 110px;
}

.test-check-table .condition-col {
  width: 440px;
}

.test-check-table .judge-col {
  width: 140px;
}

.test-check-table .seq-cell {
  width: 60px;
}

.test-check-table .test-item-cell {
  width: 190px;
}

.test-check-table .device-cell {
  width: 180px;
}

.test-check-table .qty-cell {
  width: 110px;
}

.test-check-table .condition-cell {
  width: 440px;
  padding: 0;
}

.test-check-table .judge-cell {
  width: 140px;
  padding: 0;
}

.general-check-table .seq-cell {
  width: 54px;
}

.general-check-table .item-cell {
  width: 220px;
}

.general-check-table .standard-cell {
  width: 210px;
}

.general-check-table .result-cell {
  width: 180px;
}

.general-check-table .judge-cell {
  width: 130px;
  padding: 0;
}

.general-check-table .remark-cell {
  width: 140px;
}

.general-check-table input,
.general-check-table select,
.test-check-table input,
.test-check-table select,
.test-check-table textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 6px;
  text-align: center;
  background: transparent;
  color: var(--text);
  box-sizing: border-box;
  display: block;
  font: inherit;
  font-size: 15px;
  min-width: 0;
}

.general-check-table input,
.general-check-table select {
  min-height: 48px;
  padding-left: 4px;
  padding-right: 4px;
}

.general-check-table .judge-cell select {
  text-align-last: center;
  background-color: #fff;
}

.general-check-table .judge-cell.auto-pass select {
  background-color: #eaf7f0;
  color: #047857;
  font-weight: 800;
}

.general-check-table .judge-cell.auto-fail select {
  background-color: #fff0f0;
  color: #c62828;
  font-weight: 800;
}

.general-check-table .locked-template,
.test-check-table .locked-template,
.dimension-check-table .locked-template {
  background: #f3f6f8;
  color: #64748b;
}

.general-check-table .locked-template input,
.general-check-table .locked-template select,
.test-check-table .locked-template input,
.dimension-check-table .locked-template input {
  color: #64748b;
  cursor: not-allowed;
}

.general-check-table .fillable-field,
.test-check-table .fillable-field {
  background: #fffdf1;
}

.general-check-table .template-editable,
.test-check-table .template-editable,
.dimension-check-table .template-editable {
  background: #eef9f3;
}

.test-check-table textarea {
  min-height: 54px;
  height: 100%;
  padding: 8px 10px;
  resize: none;
  text-align: left;
  line-height: 1.35;
  overflow: hidden;
}

.test-check-table .judge-cell select {
  min-height: 54px;
  text-align: center;
  text-align-last: center;
  background-color: #fff;
}

.test-check-table .qty-cell input,
.test-check-table .device-cell input,
.test-check-table .test-item-cell input {
  min-height: 54px;
}

.test-check-table tbody tr:not(:first-child) td {
  height: 56px;
}

.general-check-table input:focus,
.general-check-table select:focus,
.test-check-table input:focus,
.test-check-table select:focus,
.test-check-table textarea:focus {
  border-color: var(--brand);
  background: #fff;
  outline: none;
}

.dimension-check-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  margin: 0;
}

.dimension-check-table th,
.dimension-check-table td {
  border: 1px solid #111;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  color: #111;
  height: 42px;
  line-height: 1.35;
}

.dimension-check-table th {
  background: #f7fafc;
  font-weight: 700;
}

.dimension-check-table .side-title {
  width: 56px;
  writing-mode: vertical-rl;
  letter-spacing: 0;
  font-weight: 700;
}

.dimension-check-table .item-col {
  width: 48px;
}

.dimension-check-table .standard-col {
  width: 220px;
}

.dimension-check-table .tool-col {
  width: 150px;
}

.dimension-check-table .result-col {
  width: 150px;
}

.dimension-check-table .value-cell {
  width: 74px;
}

.dimension-check-table .value-cell.pass {
  background: #eef9f3;
  color: var(--ok);
  font-weight: 700;
}

.dimension-check-table .value-cell.fail {
  background: #fff1f0;
  color: var(--bad);
  font-weight: 700;
}

.result-mark {
  display: inline-flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.dimension-check-table input {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 5px;
  text-align: center;
  background: transparent;
  color: var(--text);
}

.dimension-check-table input:focus {
  border-color: var(--brand);
  background: #fff;
  outline: none;
}

.dimension-check-table .tool-col button {
  width: 100%;
  min-height: 34px;
  margin: 4px 6px 6px;
  width: calc(100% - 12px);
  padding: 0 6px;
}

.dimension-check-table .tool-col .dimension-tool-input {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.print-title-row {
  display: none;
}

.dimension-check-wrap .inspection-header-info table,
.dimension-check-wrap .incoming-report-table,
.dimension-check-wrap .first-article-table,
.dimension-check-wrap .general-check-table,
.dimension-check-wrap .test-check-table,
.dimension-check-wrap .dimension-check-table {
  font-size: 12px;
}

.dimension-check-wrap .inspection-header-info input,
.dimension-check-wrap .incoming-report-table input,
.dimension-check-wrap .incoming-report-table select,
.dimension-check-wrap .incoming-report-table textarea,
.dimension-check-wrap .first-article-table input,
.dimension-check-wrap .first-article-table select,
.dimension-check-wrap .first-article-table textarea,
.dimension-check-wrap .general-check-table input,
.dimension-check-wrap .general-check-table select,
.dimension-check-wrap .general-check-table textarea,
.dimension-check-wrap .test-check-table input,
.dimension-check-wrap .test-check-table select,
.dimension-check-wrap .test-check-table textarea,
.dimension-check-wrap .dimension-check-table input {
  font-size: 12px;
  min-height: 26px;
  padding: 2px 4px;
  line-height: 1.18;
}

.dimension-check-wrap .incoming-report-table textarea,
.dimension-check-wrap .first-article-table textarea,
.dimension-check-wrap .general-check-table textarea,
.dimension-check-wrap .test-check-table textarea {
  min-height: 38px;
}

.dimension-check-wrap .incoming-title,
.dimension-check-wrap .first-article-table .first-title {
  font-size: 20px;
}

.dimension-check-wrap .first-article-table .section-title,
.dimension-check-wrap .first-article-table .sub-title {
  font-size: 15px;
}

.dimension-check-wrap input,
.dimension-check-wrap select,
.dimension-check-wrap textarea,
.dimension-check-wrap button,
.dimension-check-wrap label,
.dimension-check-wrap th,
.dimension-check-wrap td,
.inspection-workspace .first-article-table input,
.inspection-workspace .first-article-table select,
.inspection-workspace .first-article-table textarea,
.inspection-workspace .first-article-table button,
.inspection-workspace .first-article-table label,
.inspection-workspace .first-article-table th,
.inspection-workspace .first-article-table td,
.inspection-workspace .print-first-article-table input,
.inspection-workspace .print-first-article-table select,
.inspection-workspace .print-first-article-table textarea,
.inspection-workspace .print-first-article-table button,
.inspection-workspace .print-first-article-table label,
.inspection-workspace .print-first-article-table th,
.inspection-workspace .print-first-article-table td,
.inspection-workspace .first-dimension-mini-table input,
.inspection-workspace .first-dimension-mini-table textarea,
.inspection-workspace .first-dimension-mini-table th,
.inspection-workspace .first-dimension-mini-table td {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

.dimension-check-wrap input,
.dimension-check-wrap textarea,
.inspection-workspace .first-article-table input,
.inspection-workspace .first-article-table textarea,
.inspection-workspace .print-first-article-table input,
.inspection-workspace .print-first-article-table textarea,
.inspection-workspace .first-dimension-mini-table input,
.inspection-workspace .first-dimension-mini-table textarea {
  appearance: none !important;
  -webkit-appearance: none !important;
}

.dimension-check-wrap input:focus,
.dimension-check-wrap select:focus,
.dimension-check-wrap textarea:focus,
.dimension-check-wrap button:focus,
.inspection-workspace .first-article-table input:focus,
.inspection-workspace .first-article-table select:focus,
.inspection-workspace .first-article-table textarea:focus,
.inspection-workspace .first-article-table button:focus,
.inspection-workspace .print-first-article-table input:focus,
.inspection-workspace .print-first-article-table select:focus,
.inspection-workspace .print-first-article-table textarea:focus,
.inspection-workspace .print-first-article-table button:focus,
.inspection-workspace .first-dimension-mini-table input:focus,
.inspection-workspace .first-dimension-mini-table textarea:focus {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
  outline: none !important;
}

.inspection-workspace .first-dimension-mini-table th,
.inspection-workspace .first-dimension-mini-table td {
  background-color: #d9f0dd !important;
}

.inspection-workspace .first-dimension-mini-table .dimension-standard-cell,
.inspection-workspace .first-dimension-mini-table textarea,
.inspection-workspace .first-dimension-mini-table input {
  background-color: transparent !important;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    background: #fff;
    color: #111;
  }

  .sidebar,
  .topbar,
  .template-fill-meta,
  .template-maintenance,
  .inspection-column-tools,
  .first-article-tools,
  .first-template-tools,
  .row-delete-btn,
  .process-add-control,
  .process-add-row-btn,
  #templatePermissionTip,
  #templateTableWrap,
  #exportDimensionCheckHtml,
  .data-tools,
  nav {
    display: none !important;
  }

  .app {
    display: block;
  }

  .main {
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #inspection.view {
    display: block !important;
  }

  #inspection > .panel:first-child,
  #inspection > .panel:nth-of-type(3),
  #inspection > .panel:nth-of-type(4) {
    display: none !important;
  }

  .dimension-check-wrap {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .compact-head {
    display: block;
    text-align: center;
    margin-bottom: 8px;
  }

  .compact-head .hint {
    display: none;
  }

  .general-check-table,
  .test-check-table,
  .inspection-header-info table,
  .incoming-report-table,
  .first-article-table,
  .dimension-check-table {
    min-width: 0;
    width: 100%;
    page-break-inside: avoid;
    break-inside: avoid;
    font-size: 8.5px;
  }

  .general-check-table th,
  .general-check-table td,
  .test-check-table th,
  .test-check-table td,
  .inspection-header-info th,
  .inspection-header-info td,
  .incoming-report-table th,
  .incoming-report-table td,
  .first-article-table th,
  .first-article-table td,
  .dimension-check-table th,
  .dimension-check-table td {
    padding: 1px 2px;
    height: 22px;
    min-height: 22px;
    line-height: 1.15;
  }

  .general-check-table input,
  .general-check-table select,
  .general-check-table textarea,
  .inspection-header-info input,
  .incoming-report-table input,
  .incoming-report-table select,
  .incoming-report-table textarea,
  .first-article-table input,
  .first-article-table select,
  .first-article-table textarea,
  .test-check-table input,
  .test-check-table select,
  .test-check-table textarea,
  .dimension-check-table input {
    min-height: 16px;
    border: 0;
    padding: 0 1px;
    color: #111;
    font-size: 8.5px;
    line-height: 1.12;
    appearance: none;
  }

  .incoming-report-table textarea,
  .first-article-table textarea,
  .general-check-table textarea,
  .test-check-table textarea {
    min-height: 24px;
  }

  .incoming-report-table .incoming-title,
  .first-article-table .first-title {
    font-size: 14px;
    height: 22px;
  }

  .first-article-table .section-title,
  .first-article-table .sub-title {
    font-size: 10px;
  }

  .first-reason-buttons {
    gap: 2px;
    padding: 1px;
    min-height: 18px;
  }

  .first-reason-buttons label {
    min-height: 16px;
    padding: 0 3px;
    border-radius: 3px;
    font-size: 8.5px;
    gap: 2px;
  }

  .first-reason-buttons input {
    width: 8px;
    height: 8px;
  }

  .incoming-report-table .dimension-limit-row td {
    height: 34px;
    min-height: 34px;
  }

  .incoming-report-table .dimension-limit-row input,
  .incoming-report-table .dimension-limit-row textarea {
    min-height: 20px;
    font-size: 8px;
  }

  .dimension-inline-actuals {
    min-height: 20px;
  }

  .dimension-inline-actuals input {
    min-height: 20px;
    font-size: 8px;
  }

  .general-check-table .general-title,
  .test-check-table .general-title,
  .dimension-check-table .side-title {
    width: 36px;
  }

  .general-check-table .seq-col,
  .test-check-table .seq-col {
    width: 34px;
  }

  .general-check-table .item-col,
  .general-check-table .standard-col,
  .general-check-table .result-col,
  .general-check-table .remark-col {
    width: auto;
  }

  .general-check-table .judge-col,
  .test-check-table .judge-col {
    width: 72px;
  }

  .test-check-table .condition-col {
    width: 220px;
  }

  .test-check-table textarea {
    text-align: left;
    line-height: 1.2;
  }

  .dimension-check-table .tool-col button {
    display: none !important;
  }

  .template-table-wrap {
    overflow: visible;
    border: 0;
  }
}

.template-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.excel-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.excel-table th,
.excel-table td {
  min-width: 120px;
  height: 38px;
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: middle;
}

.excel-table th {
  background: #e8f3f4;
  color: var(--text);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.excel-table td.locked {
  background: #f5f7f9;
  color: #405166;
}

.excel-table td.fillable {
  background: #fffdf1;
}

.excel-table td.supervisor-editable {
  background: #eef9f3;
}

.excel-table input {
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  background: transparent;
}

.excel-table input:focus {
  border-color: var(--brand);
  background: #fff;
  outline: none;
}

.tag {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.tag.ok {
  background: var(--ok);
}

.tag.warn {
  background: var(--warn);
}

.tag.bad {
  background: var(--bad);
}

.tag.gray {
  background: #6b7787;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.item b,
.item span {
  display: block;
}

.item span {
  color: var(--muted);
  font-size: 13px;
}

.notice-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}

.notice-todo {
  border: 1px solid #f5a524;
  color: #8a4b00;
  background: #fff4d6;
}

.notice-copy {
  border: 1px solid #60a5fa;
  color: #075985;
  background: #e0f2fe;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.lane {
  min-height: 260px;
  padding: 12px;
  background: #f6f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lane h3 {
  margin-bottom: 10px;
}

.card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 32, 46, 0.06);
}

.card.closed {
  border-left-color: var(--ok);
}

.abnormal-card span {
  color: var(--muted);
  font-size: 13px;
}

.abnormal-card textarea {
  min-height: 58px;
  padding: 7px 9px;
  font-size: 13px;
}

.abnormal-guidance {
  color: var(--bad);
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
}

.incoming-8d-note {
  display: block;
  color: #9a3412;
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
}

.reject-note {
  display: block;
  padding: 7px 9px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.45;
}

.recurrence-note {
  display: block;
  padding: 8px 10px;
  border: 1px solid #ffb4a8;
  border-radius: 8px;
  background: #fff1f0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.45;
}

.abnormal-8d-upload {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px dashed #e3a253;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 700;
}

.abnormal-8d-upload input {
  min-height: 34px;
  padding: 5px 8px;
  background: #fff;
  font-weight: 400;
}

.abnormal-verification {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #9fcbd2;
  border-radius: 8px;
  background: #f4fbfc;
}

.abnormal-verification b {
  color: #075985;
}

.verification-progress {
  display: flex;
  gap: 6px;
}

.verification-progress span {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid #9fcbd2;
  border-radius: 50%;
  color: #64748b;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.verification-progress span.done {
  border-color: #0f766e;
  color: #fff;
  background: #0f766e;
}

.abnormal-verification table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}

.abnormal-verification th,
.abnormal-verification td {
  border: 1px solid #cbd5e1;
  padding: 5px 6px;
  text-align: center;
}

.verification-inputs {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.verification-inputs input {
  min-height: 36px;
  padding: 7px 9px;
}

.qe-review-box {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  padding: 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.qe-review-box b {
  grid-column: 1 / -1;
  color: #075985;
}

.qe-review-box input {
  min-height: 36px;
  padding: 7px 9px;
}

.ok-text {
  color: var(--ok) !important;
  font-weight: 700;
}

.defect-approval-list {
  display: grid;
  gap: 10px;
}

.defect-approval-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(145px, 0.7fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfd;
}

.defect-approval-card.incoming-material-flow {
  border-color: #e3a253;
  background: #fffbeb;
}

.defect-approval-card b,
.defect-approval-card span {
  display: block;
}

.defect-approval-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.defect-approval-card select {
  min-height: 36px;
}

.defect-approval-card textarea {
  min-height: 64px;
  padding: 7px 9px;
  font-size: 13px;
}

.defect-approval-card textarea,
.defect-approval-card .hint,
.defect-approval-card .actions {
  grid-column: 1 / -1;
}

.analytics-summary {
  padding: 12px 14px;
  border: 1px solid #9ed4dc;
  border-radius: 8px;
  background: #eefbfc;
  color: #084b5a;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 700;
}

.analytics-rank-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.analytics-rank-grid section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.analytics-rank-grid h3 {
  margin-bottom: 10px;
  font-size: 15px;
  color: #102033;
}

.analytics-rank {
  display: grid;
  gap: 9px;
}

.analytics-rank-item {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid #d6e6ee;
  border-radius: 8px;
  background: #fff;
}

.analytics-rank-item span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: #102033;
}

.analytics-rank-item span b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e6f5f8;
  color: var(--primary);
  font-size: 12px;
  flex: 0 0 auto;
}

.analytics-rank-item i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef3;
}

.analytics-rank-item i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #128391, #1d72c3);
}

.analytics-rank-item strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

canvas {
  width: 100%;
  height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.stats-grid span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--muted);
}

.stats-grid b {
  color: var(--text);
}

.rank {
  display: grid;
  gap: 12px;
}

.rank-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: #e5edf3;
  overflow: hidden;
}

.bar i {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--accent);
}

.report-paper {
  min-height: 420px;
  padding: 26px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: inset 0 0 0 9px #f5f8fb;
  line-height: 1.8;
}

.report-paper h2 {
  text-align: center;
  font-size: 24px;
}

.mobile-wrap {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 16px;
  align-items: start;
}

.phone {
  padding: 18px;
  max-width: 390px;
  border: 12px solid #17242d;
  border-radius: 28px;
}

.phone form {
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 13px 16px;
  background: #13232e;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(5, 1fr);
  }

  nav button {
    text-align: center;
  }

  .metrics,
  .grid.two,
  .dash-summary,
  .mobile-wrap {
    grid-template-columns: 1fr 1fr;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-wide {
    grid-column: auto;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inspection-workspace {
    grid-template-columns: 1fr;
  }

  .template-fill-meta {
    grid-template-columns: 1fr 1fr;
  }

  .sip-wizard {
    grid-template-columns: 1fr 1fr;
  }

  .quick-sip-bar {
    grid-template-columns: 1fr 1fr;
  }

  .inspection-module-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .first-article-tools {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 14px;
  }

  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  nav,
  .metrics,
  .grid.two,
  .dash-summary,
  .dash-grid,
  .form-grid,
  .stats-grid,
  .bluetooth-measure-panel,
  .bt-result,
  .mobile-wrap {
    grid-template-columns: 1fr;
  }

  .sip-wizard {
    grid-template-columns: 1fr;
  }

  .dash-rank-row {
    grid-template-columns: 28px minmax(80px, 1fr) minmax(80px, 1fr);
  }

  .dash-rank-row em {
    grid-column: 2 / -1;
  }

  .quick-sip-bar {
    grid-template-columns: 1fr;
  }

  .resident-defect-head,
  .resident-defect-row {
    grid-template-columns: 1fr;
  }

  .inspection-entry-grid {
    grid-template-columns: 1fr;
  }

  .template-fill-meta {
    grid-template-columns: 1fr;
  }

  .template-fill-meta select,
  .template-fill-meta .primary {
    grid-column: auto;
  }

  .first-article-tools {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .kanban {
    grid-template-columns: repeat(5, 240px);
  }

  .inspection-module-tabs {
    grid-template-columns: 1fr;
  }
}

/* Final compact override: keep inspection report rows from being stretched by inputs/uploads. */
.inspection-workspace .first-article-table th,
.inspection-workspace .first-article-table td,
.inspection-workspace .incoming-report-table th,
.inspection-workspace .incoming-report-table td,
.inspection-workspace .high-pressure-patrol-table th,
.inspection-workspace .high-pressure-patrol-table td {
  padding: 0 !important;
  line-height: 1.1 !important;
}

.inspection-workspace .first-article-table .process-confirm-row td,
.inspection-workspace .first-article-table .process-confirm-row th {
  height: 54px !important;
  min-height: 54px !important;
  font-size: 11px !important;
}

.inspection-workspace .first-article-table .process-confirm-row textarea {
  min-height: 30px !important;
  height: 30px !important;
  max-height: 36px !important;
  padding: 1px 3px !important;
  font-size: 11px !important;
  line-height: 1.12 !important;
}

.inspection-workspace .first-article-table .process-confirm-row .template-evidence-toggle,
.inspection-workspace .first-article-table .process-confirm-row .evidence-upload-btn,
.inspection-workspace .first-article-table .process-confirm-row .first-reason-buttons label {
  min-height: 18px !important;
  height: 18px !important;
  padding: 1px 4px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.inspection-workspace .first-article-table .process-confirm-row .row-evidence-box {
  margin-top: 1px !important;
  padding: 1px 2px !important;
}

.inspection-workspace .first-article-table .process-confirm-row .row-evidence-head {
  margin-bottom: 1px !important;
  gap: 2px !important;
  font-size: 10px !important;
}

.inspection-workspace .first-article-table .process-confirm-row .row-evidence-thumbs img {
  width: 18px !important;
  height: 18px !important;
}

.inspection-workspace .first-article-table .first-dimension-result-row td,
.inspection-workspace .first-article-table .dimension-limit-row td {
  height: 46px !important;
  min-height: 46px !important;
}

.inspection-workspace .first-dimension-mini-table th,
.inspection-workspace .first-dimension-mini-table td {
  height: 22px !important;
  min-height: 22px !important;
  font-size: 11px !important;
}

.inspection-workspace .first-dimension-mini-table input,
.inspection-workspace .dimension-actual-input {
  height: 20px !important;
  min-height: 20px !important;
  font-size: 11px !important;
  padding: 0 2px !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Dense print-friendly report controls. */
.inspection-workspace .print-first-article-table {
  font-size: 12px !important;
}

.inspection-workspace .print-first-article-table th,
.inspection-workspace .print-first-article-table td {
  font-size: 12px !important;
  line-height: 1.08 !important;
  vertical-align: middle !important;
}

.inspection-workspace .print-first-article-table input,
.inspection-workspace .print-first-article-table select,
.inspection-workspace .print-first-article-table textarea {
  width: 100% !important;
  min-height: 18px !important;
  height: 18px !important;
  padding: 1px 3px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 11px !important;
  line-height: 1.08 !important;
  overflow: hidden !important;
  resize: none !important;
}

.inspection-workspace .print-first-article-table textarea {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 42px !important;
  overflow: auto !important;
}

.inspection-workspace .print-first-article-table td:nth-child(3) textarea,
.inspection-workspace .print-first-article-table td:nth-child(4) textarea {
  height: 42px !important;
  min-height: 42px !important;
}

.inspection-workspace .print-first-article-table .row-delete-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-height: 18px !important;
  height: 18px !important;
  margin: 2px auto 0 !important;
  padding: 0 6px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  border-radius: 5px !important;
}

.inspection-workspace .print-first-article-table .first-reason-buttons {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 20px !important;
  padding: 0 3px !important;
  overflow: hidden !important;
}

.inspection-workspace .print-first-article-table .first-reason-buttons label {
  min-height: 20px !important;
  height: 20px !important;
  padding: 1px 5px !important;
  gap: 2px !important;
  font-size: 11px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.inspection-workspace .print-first-article-table .first-reason-buttons input {
  width: 12px !important;
  height: 12px !important;
  min-height: 0 !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row th,
.inspection-workspace .print-first-article-table .first-header-option-row td {
  height: 28px !important;
  min-height: 28px !important;
  padding: 1px 4px !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-reason-buttons {
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
  gap: 4px 6px !important;
  min-height: 24px !important;
  padding: 2px 5px !important;
  overflow: visible !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-reason-buttons label {
  height: 20px !important;
  min-height: 20px !important;
  padding: 1px 6px !important;
  background: #fff !important;
  border: 1px solid #9fc7d8 !important;
  border-radius: 5px !important;
  font-weight: 500 !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-basis-cell .first-reason-buttons label {
  min-width: 48px !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  padding: 2px 7px !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-basis-cell .first-reason-buttons input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  margin: 0 !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  accent-color: #0f7f8c !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-reason-buttons label:has(input:checked),
.inspection-workspace .print-first-article-table .first-reason-buttons label:has(input:checked) {
  background: #087f9b !important;
  border-color: #055f77 !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35) !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-reason-buttons label:has(input:checked) input,
.inspection-workspace .print-first-article-table .first-reason-buttons label:has(input:checked) input {
  accent-color: #fff !important;
  outline: 1px solid rgba(255, 255, 255, 0.8) !important;
  outline-offset: 1px !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-basis-cell .first-reason-buttons label:has(input:checked) {
  background: #fff !important;
  border-color: #9fc7d8 !important;
  color: #102033 !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

.inspection-workspace .print-first-article-table .first-header-option-row .first-basis-cell .first-reason-buttons label:has(input:checked) input {
  accent-color: #0f7f8c !important;
  outline: none !important;
}

.inspection-workspace .print-first-article-table .first-basis-warning-row[hidden] {
  display: none !important;
}

.inspection-workspace .print-first-article-table .first-basis-warning-row td {
  height: 26px !important;
  min-height: 26px !important;
  padding: 3px 10px !important;
  background: #fff6d8 !important;
  color: #7a4b00 !important;
  border-color: #c7922b !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-align: left !important;
}

.inspection-workspace .print-first-article-table.first-basis-blocked .first-basis-gated-row input:not([data-template-section]):not([data-template-title-field]),
.inspection-workspace .print-first-article-table.first-basis-blocked .first-basis-gated-row textarea:not([data-template-section]):not([data-template-title-field]),
.inspection-workspace .print-first-article-table.first-basis-blocked .first-basis-gated-row select:not([data-template-section]):not([data-template-title-field]) {
  background: #f3f7f9 !important;
  color: #7a8792 !important;
  cursor: not-allowed !important;
}

.inspection-workspace .print-first-article-table.first-basis-blocked .first-basis-gated-row label {
  opacity: 0.72;
  cursor: not-allowed !important;
}

.inspection-workspace .print-first-article-table.first-basis-blocked .first-basis-gated-row [data-dimension-actual] {
  background: #f3f7f9 !important;
  color: #7a8792 !important;
  cursor: not-allowed !important;
}

.inspection-workspace .first-dimension-result-row td {
  height: 56px !important;
  min-height: 56px !important;
}

.inspection-workspace .first-dimension-mini-table th,
.inspection-workspace .first-dimension-mini-table td {
  height: 20px !important;
  min-height: 20px !important;
  font-size: 11px !important;
  line-height: 1 !important;
}

.inspection-workspace .first-dimension-mini-table textarea {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 1px 3px !important;
  font-size: 10.5px !important;
  line-height: 1.08 !important;
  overflow: auto !important;
}

.inspection-workspace .first-dimension-mini-table .dimension-actual-input {
  height: 34px !important;
  min-height: 34px !important;
  border-left: 1px solid #111 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 12px !important;
}

.inspection-workspace .process-confirm-row td,
.inspection-workspace .process-confirm-row th {
  height: 42px !important;
  min-height: 42px !important;
}

.inspection-workspace .process-confirm-row td:nth-child(4) textarea {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
}

.inspection-workspace .process-confirm-row td:nth-child(7) {
  font-size: 10px !important;
}

.inspection-workspace .process-confirm-row td:nth-child(7) textarea {
  height: 18px !important;
  min-height: 18px !important;
  max-height: 20px !important;
}

.inspection-workspace .process-confirm-row .template-evidence-toggle {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 !important;
}

.inspection-workspace .process-confirm-row .row-evidence-box {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1px !important;
  margin-top: 1px !important;
  padding: 1px 2px !important;
  border-radius: 4px !important;
  min-height: 0 !important;
}

.inspection-workspace .process-confirm-row .row-evidence-head {
  display: flex !important;
  justify-content: space-between !important;
  white-space: nowrap !important;
  align-items: center !important;
  gap: 2px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.inspection-workspace .process-confirm-row .evidence-only-cell {
  padding: 1px 2px !important;
  vertical-align: middle !important;
}

.inspection-workspace .process-confirm-row .evidence-only-cell textarea {
  display: none !important;
}

.inspection-workspace .process-confirm-row .evidence-only-cell .template-evidence-toggle {
  height: 18px !important;
  min-height: 18px !important;
  padding: 1px 3px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

.inspection-workspace .process-confirm-row .evidence-only-cell .evidence-upload-btn {
  min-height: 18px !important;
  height: 18px !important;
  padding: 0 4px !important;
  font-size: 10px !important;
}

.inspection-workspace .process-confirm-row .evidence-only-cell .row-evidence-thumbs {
  display: flex !important;
  gap: 2px !important;
}

.inspection-workspace .process-confirm-row .evidence-only-cell .row-evidence-thumbs img {
  width: 18px !important;
  height: 18px !important;
}

.inspection-workspace .print-first-article-table textarea.compact-text-short {
  height: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
}

.inspection-workspace .print-first-article-table textarea.compact-text-medium {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 32px !important;
}

.inspection-workspace .print-first-article-table textarea.compact-text-long {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 44px !important;
  overflow: auto !important;
}

.inspection-workspace .print-first-article-table input.compact-input-long {
  font-size: 10px !important;
  letter-spacing: 0 !important;
}

.inspection-workspace .print-first-article-table .process-confirm-row td:nth-child(2),
.inspection-workspace .print-first-article-table .process-confirm-row td:nth-child(3),
.inspection-workspace .print-first-article-table .process-confirm-row td:nth-child(5),
.inspection-workspace .print-first-article-table .first-dimension-result-row > td:nth-child(2),
.inspection-workspace .print-first-article-table .first-dimension-result-row > td:nth-child(5) {
  font-size: 11px !important;
}

.inspection-workspace .print-first-article-table .process-confirm-row td:nth-child(6) .first-reason-buttons,
.inspection-workspace .print-first-article-table .first-dimension-result-row > td:nth-last-child(2) .first-reason-buttons {
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 3px !important;
}

.inspection-workspace .print-first-article-table .process-confirm-row td:nth-child(6) .first-reason-buttons label,
.inspection-workspace .print-first-article-table .first-dimension-result-row > td:nth-last-child(2) .first-reason-buttons label {
  width: auto !important;
  min-width: 54px !important;
}

.inspection-workspace .print-first-article-table .process-confirm-row td:nth-child(7) .row-evidence-box {
  max-height: 42px !important;
  overflow: hidden !important;
}

.inspection-workspace .print-first-article-table .process-confirm-row td:nth-child(7) .row-evidence-box:has(.row-evidence-thumbs img) {
  max-height: 62px !important;
}

.inspection-workspace .first-reason-buttons input[type="checkbox"],
.inspection-workspace .first-reason-buttons input[type="radio"],
.dimension-check-wrap .first-reason-buttons input[type="checkbox"],
.dimension-check-wrap .first-reason-buttons input[type="radio"],
.incoming-options .first-reason-buttons input[type="checkbox"],
.incoming-options .first-reason-buttons input[type="radio"] {
  position: relative !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  margin: 0 3px 0 0 !important;
  padding: 0 !important;
  border: 1px solid #7fa9b5 !important;
  border-radius: 3px !important;
  background: #fff !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
  vertical-align: middle !important;
}

.inspection-workspace .first-reason-buttons input[type="checkbox"]:checked,
.inspection-workspace .first-reason-buttons input[type="radio"]:checked,
.dimension-check-wrap .first-reason-buttons input[type="checkbox"]:checked,
.dimension-check-wrap .first-reason-buttons input[type="radio"]:checked,
.incoming-options .first-reason-buttons input[type="checkbox"]:checked,
.incoming-options .first-reason-buttons input[type="radio"]:checked {
  border-color: #087f9b !important;
  background: #087f9b !important;
}

.inspection-workspace .first-reason-buttons input[type="checkbox"]:checked::after,
.inspection-workspace .first-reason-buttons input[type="radio"]:checked::after,
.dimension-check-wrap .first-reason-buttons input[type="checkbox"]:checked::after,
.dimension-check-wrap .first-reason-buttons input[type="radio"]:checked::after,
.incoming-options .first-reason-buttons input[type="checkbox"]:checked::after,
.incoming-options .first-reason-buttons input[type="radio"]:checked::after {
  content: "" !important;
  position: absolute !important;
  left: 4px !important;
  top: 1px !important;
  width: 4px !important;
  height: 8px !important;
  border: solid #fff !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
}

.inspection-workspace .print-first-article-table textarea.compact-text-short,
.inspection-workspace .print-first-article-table textarea.compact-text-medium,
.inspection-workspace .print-first-article-table textarea.compact-text-long,
.inspection-workspace .first-article-table .process-confirm-row textarea,
.inspection-workspace .incoming-report-table textarea,
.inspection-workspace .high-pressure-patrol-table textarea {
  max-height: none !important;
  overflow: hidden !important;
  resize: none !important;
}

.inspection-workspace .print-first-article-table td,
.inspection-workspace .first-article-table .process-confirm-row td,
.inspection-workspace .first-article-table .process-confirm-row th {
  height: auto !important;
}

.warning-card-alert {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #f2c36b;
  border-left: 6px solid #c66b2d;
  border-radius: 8px;
  background: #fff7e8;
}

.open-abnormal-alert {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 2px solid #d92d20;
  border-left-width: 8px;
  border-radius: 8px;
  background: #fff1f0;
  box-shadow: 0 8px 22px rgba(217, 45, 32, 0.16);
}

.open-abnormal-alert[hidden] {
  display: none !important;
}

.open-abnormal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #8a1f16;
}

.open-abnormal-head b {
  font-size: 20px;
}

.open-abnormal-head span {
  font-size: 14px;
  font-weight: 800;
}

.open-abnormal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.open-abnormal-list article {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #f2a29a;
  border-radius: 6px;
  background: #fffafa;
}

.open-abnormal-list strong {
  color: #9f1d14;
}

.open-abnormal-list span,
.open-abnormal-list em {
  color: #4c1712;
  font-size: 13px;
  font-style: normal;
}

.warning-card-alert[hidden] {
  display: none !important;
}

.warning-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6c3e08;
}

.warning-alert-head b {
  font-size: 18px;
}

.warning-alert-head span {
  color: #8a5a18;
  font-size: 13px;
}

.warning-card-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.warning-card {
  overflow: hidden;
  border: 1px solid #1f5c68;
  border-radius: 8px;
  background: #fff;
}

.warning-card-title {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: center;
  background: linear-gradient(90deg, #074f70, #087989);
  color: #fff;
}

.warning-card-title span {
  font-size: 12px;
  font-weight: 700;
}

.warning-card-title h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.warning-card-title b {
  font-size: 18px;
  line-height: 1.25;
}

.warning-card-title em {
  font-style: normal;
  font-size: 12px;
  opacity: 0.9;
}

.warning-card-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.warning-card-table th,
.warning-card-table td {
  border: 1px solid #1f2f3a;
  padding: 7px 8px;
  font-size: 13px;
  line-height: 1.45;
  vertical-align: middle;
  word-break: break-word;
}

.warning-card-table th {
  width: 96px;
  background: #dce8f5;
  text-align: center;
  font-weight: 800;
}

.warning-card-table td {
  background: #d9f0df;
}

.warning-card-compact .warning-card-table th,
.warning-card-compact .warning-card-table td {
  padding: 6px 7px;
  font-size: 12px;
}

.warning-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #f7fbfd;
}

.warning-card-form textarea {
  min-height: 60px;
}

.warning-image-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.warning-image-upload {
  display: grid;
  gap: 7px;
  min-height: 120px;
  padding: 10px;
  border: 1px dashed #8bc6bf;
  border-radius: 8px;
  background: #f7fcfb;
}

.warning-image-upload span {
  font-weight: 800;
  color: #073d5e;
}

.warning-image-upload small {
  color: var(--muted);
}

.warning-image-preview {
  display: grid;
  min-height: 150px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d5e4ed;
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
}

.warning-image-preview img,
.warning-image-cell img {
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  display: block;
}

.warning-image-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.warning-image-cell {
  display: grid;
  gap: 6px;
  min-height: 260px;
  align-content: start;
  padding: 8px;
  border: 1px solid #a5bdc9;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.warning-image-cell span {
  color: var(--muted);
}

/* Keep dimension inspection blocks flat; outer zebra rows must not tint them. */
.inspection-workspace .first-article-table .first-dimension-result-row > td,
.inspection-workspace .first-article-table .dimension-limit-row > td,
.inspection-workspace .print-first-article-table .first-dimension-result-row > td,
.inspection-workspace .print-first-article-table .dimension-limit-row > td,
.dimension-check-wrap .first-article-table .first-dimension-result-row > td,
.dimension-check-wrap .first-article-table .dimension-limit-row > td {
  background: #d9f0dd !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
}

.inspection-workspace .first-dimension-mini-table,
.inspection-workspace .first-dimension-mini-table th,
.inspection-workspace .first-dimension-mini-table td,
.inspection-workspace .print-first-article-table .first-dimension-mini-table,
.inspection-workspace .print-first-article-table .first-dimension-mini-table th,
.inspection-workspace .print-first-article-table .first-dimension-mini-table td,
.dimension-check-wrap .first-dimension-mini-table,
.dimension-check-wrap .first-dimension-mini-table th,
.dimension-check-wrap .first-dimension-mini-table td {
  background: #d9f0dd !important;
  background-color: #d9f0dd !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
}

.inspection-workspace .first-dimension-mini-table .dimension-mini-title,
.inspection-workspace .first-dimension-mini-table .dimension-standard-head,
.inspection-workspace .first-dimension-mini-table .dimension-limit-head,
.inspection-workspace .first-dimension-mini-table .dimension-actual-head,
.inspection-workspace .print-first-article-table .first-dimension-mini-table .dimension-mini-title,
.inspection-workspace .print-first-article-table .first-dimension-mini-table .dimension-standard-head,
.inspection-workspace .print-first-article-table .first-dimension-mini-table .dimension-limit-head,
.inspection-workspace .print-first-article-table .first-dimension-mini-table .dimension-actual-head,
.dimension-check-wrap .first-dimension-mini-table .dimension-mini-title,
.dimension-check-wrap .first-dimension-mini-table .dimension-standard-head,
.dimension-check-wrap .first-dimension-mini-table .dimension-limit-head,
.dimension-check-wrap .first-dimension-mini-table .dimension-actual-head {
  background: #c7e8cf !important;
  background-color: #c7e8cf !important;
}

.inspection-workspace .first-dimension-mini-table input:not(.dimension-actual-input),
.inspection-workspace .first-dimension-mini-table textarea,
.inspection-workspace .print-first-article-table .first-dimension-mini-table input:not(.dimension-actual-input),
.inspection-workspace .print-first-article-table .first-dimension-mini-table textarea,
.dimension-check-wrap .first-dimension-mini-table input:not(.dimension-actual-input),
.dimension-check-wrap .first-dimension-mini-table textarea {
  background: transparent !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
}

.inspection-workspace .first-dimension-mini-table .dimension-actual-input,
.inspection-workspace .print-first-article-table .first-dimension-mini-table .dimension-actual-input,
.dimension-check-wrap .first-dimension-mini-table .dimension-actual-input {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 30px !important;
  background: #f8fbff !important;
  color: #0f172a;
  cursor: text;
  caret-color: #087f9b;
  pointer-events: auto;
}

.inspection-workspace .dimension-inline-actuals .dimension-actual-input,
.dimension-check-wrap .dimension-inline-actuals .dimension-actual-input {
  display: block;
  width: 100% !important;
  min-height: 34px !important;
  background: #f8fbff !important;
  color: #0f172a;
  cursor: text;
  caret-color: #087f9b;
  pointer-events: auto;
}

.inspection-workspace .first-dimension-mini-table .dimension-actual-input:focus,
.inspection-workspace .print-first-article-table .first-dimension-mini-table .dimension-actual-input:focus,
.dimension-check-wrap .first-dimension-mini-table .dimension-actual-input:focus {
  background: #ffffff !important;
  outline: 1px solid #087f9b !important;
  outline-offset: -1px !important;
}

@media (max-width: 1280px) {
  .screen-kpis {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .screen-grid {
    grid-template-columns: 1fr;
  }

  .screen-card-tall,
  .screen-stage {
    min-height: 220px;
  }
}

@media (max-width: 760px) {
  .production-screen {
    padding: 10px;
  }

  .screen-topbar {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .screen-topbar em {
    justify-self: center;
  }

  .screen-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .screen-table-wrap {
    overflow-x: auto;
  }

  .screen-table {
    min-width: 760px;
  }
}

@media print {
  .inspection-workspace .print-first-article-table {
    font-size: 10px !important;
  }

  .inspection-workspace .print-first-article-table th,
  .inspection-workspace .print-first-article-table td {
    font-size: 10px !important;
  }

  .inspection-workspace .print-first-article-table textarea {
    scrollbar-width: none;
  }

  .inspection-workspace .row-delete-btn,
  .inspection-workspace .dimension-add-row-btn,
  .inspection-workspace .evidence-upload-btn,
  .inspection-workspace .template-evidence-toggle {
    display: none !important;
  }

  .warning-card-actions,
  .warning-alert-head {
    display: none !important;
  }

  .warning-card {
    page-break-inside: avoid;
  }
}
