:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #687789;
  --line: #d8e0e8;
  --line-strong: #bac7d5;
  --nav-bg: #0f1828;
  --nav-hover: #18263a;
  --nav-active: #26384e;
  --blue: #2b5f9f;
  --green: #16805d;
  --amber: #ad6500;
  --shadow: 0 12px 32px rgba(24, 35, 51, 0.08);
}

.job-drawing-cell button {
  width: 100%;
  padding: 5px 3px;
  border: 1px solid #bac7d5;
  border-radius: 4px;
  background: #f6f8fb;
  color: #687789;
  font-size: 12px;
  white-space: nowrap;
}

.job-drawing-cell button.has-drawings {
  border-color: #16805d;
  background: #e5f5ed;
  color: #116344;
  font-weight: 700;
}

.job-drawings-dialog {
  width: min(1280px, 96vw);
  height: min(860px, 92dvh);
  max-width: 96vw;
  max-height: 92dvh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 24px 80px #0f182855;
}

.job-drawings-dialog[open] { display: flex; flex-direction: column; }
.job-drawings-dialog::backdrop { background: #0f1828a6; }
.job-drawings-dialog [hidden] { display: none !important; }
.job-drawings-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 12px; }
.job-drawings-header h2 { margin: 0; font-size: 21px; }
.job-drawings-job { margin: 6px 0 0; overflow-wrap: anywhere; color: var(--muted); }
.job-drawings-dialog button { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #f6f8fb; color: var(--ink); }
.job-drawings-dialog button:disabled { opacity: .55; cursor: wait; }
.job-drawings-dialog button:focus-visible, .job-drawings-dialog a:focus-visible { outline: 3px solid #397abf; outline-offset: 2px; }
.job-drawings-header button { flex-shrink: 0; }
.job-drawings-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 0 20px; }
.job-drawings-toolbar [data-drawing-upload] { background: var(--blue); color: white; border-color: var(--blue); }
.job-drawings-toolbar span { font-size: 12px; color: var(--muted); }
.job-drawings-status { min-height: 20px; margin: 10px 20px; overflow-wrap: anywhere; }
.job-drawings-status.is-error { color: #b32323; }
.job-drawings-body { flex: 1; display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 0; border-top: 1px solid var(--line); }
.job-drawings-files { overflow: auto; padding: 12px; border-right: 1px solid var(--line); background: #f6f8fb; }
.job-drawings-files p { color: var(--muted); line-height: 1.6; }
.job-drawings-files .job-drawing-file { width: 100%; display: block; text-align: left; margin-bottom: 8px; background: white; overflow-wrap: anywhere; }
.job-drawing-file strong, .job-drawing-file small { display: block; }
.job-drawing-file small { margin-top: 6px; color: var(--muted); line-height: 1.6; }
.job-drawing-file[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 3px 0 var(--blue); background: #edf4ff; }
.job-drawings-preview { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #e8edf3; }
.job-drawings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 14px; background: white; }
.job-drawings-selected { flex: 1; min-width: 100px; overflow-wrap: anywhere; }
.job-drawings-actions a { color: var(--blue); text-decoration: underline; }
.job-drawings-actions [data-drawing-delete] { border-color: #e4aaaa; color: #a72323; background: #fff4f4; }
.job-drawings-placeholder { flex: 1; display: grid; place-items: center; padding: 20px; text-align: center; overflow-wrap: anywhere; }
.job-drawings-preview iframe { width: 100%; flex: 1; min-height: 0; border: 0; background: white; }
.job-drawings-preview > small { padding: 8px 12px; color: #4c5c70; }

@media (max-width: 680px) {
  .job-drawings-dialog { width: 98vw; max-width: 98vw; height: 96dvh; max-height: 96dvh; }
  .job-drawings-header { padding: 12px; }
  .job-drawings-header h2 { font-size: 17px; }
  .job-drawings-toolbar { padding: 0 12px; }
  .job-drawings-status { margin: 8px 12px; font-size: 12px; }
  .job-drawings-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(65px, 24%) minmax(0, 1fr); }
  .job-drawings-files { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .job-drawings-files .job-drawing-file { padding: 6px 10px; margin-bottom: 5px; }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Segoe UI",
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    Arial,
    sans-serif;
  font-size: 14px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

body.is-login {
  overflow: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f5;
}

.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 34px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  display: block;
  width: 190px;
  height: 74px;
  object-fit: contain;
  margin: 0 auto 20px;
}

.login-panel h1 {
  margin: 0;
  color: #17202a;
  font-size: 28px;
  letter-spacing: 0;
}

.login-panel p {
  margin: 10px 0 22px;
  color: #687789;
  font-weight: 700;
}

.login-actions {
  display: grid;
  gap: 10px;
}

.login-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #17202a;
}

.login-form input:focus {
  outline: 3px solid rgba(43, 95, 159, 0.18);
  border-color: #2b5f9f;
}

.login-error {
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff1f1;
  color: #b42318;
  font-weight: 800;
}

.login-error[hidden] {
  display: none;
}

.login-button {
  justify-content: center;
  min-height: 44px;
}

.company-selector {
  min-width: 0;
  margin: 2px 0 0;
  border: 0;
  padding: 0;
}

.company-selector legend {
  margin-bottom: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

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

@media (max-width: 640px) {
  .company-options {
    grid-template-columns: 1fr;
  }
}

.company-option {
  display: grid;
  min-width: 0;
  min-height: 86px;
  place-items: center;
  gap: 5px;
  border: 2px solid #d8e0e8;
  border-radius: 8px;
  padding: 7px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.company-option img {
  display: block;
  width: 100%;
  height: 42px;
  object-fit: contain;
}

.company-option.is-selected {
  border-color: #2b5f9f;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(43, 95, 159, 0.12);
}

.is-resizable-column {
  position: relative;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  z-index: 8;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 20%;
  right: 3px;
  width: 1px;
  height: 60%;
  background: rgba(148, 163, 184, 0.7);
  opacity: 0;
}

.is-resizable-column:hover .column-resize-handle::after,
.column-resize-handle:hover::after,
body.is-resizing-column .column-resize-handle::after {
  opacity: 1;
}

body.is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 12px;
  overflow-y: auto;
  background: var(--nav-bg);
  color: #f8fafc;
}

.brand {
  display: block;
  padding: 4px 0 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 150px;
  border: 1px solid rgba(147, 197, 253, 0.35);
  border-radius: 8px;
  padding: 8px;
  overflow: hidden;
  background: #ffffff;
  appearance: none;
}

.brand-mark:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.45);
  outline-offset: 3px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: contain;
}

.company-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 24, 40, 0.62);
}

.company-picker-backdrop[hidden] {
  display: none;
}

.company-picker-panel {
  width: min(720px, 100%);
  max-height: min(720px, 90vh);
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.company-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.company-picker-head h2 {
  margin: 0;
  color: #17202a;
  font-size: 22px;
}

.company-picker-head p {
  margin: 5px 0 0;
  color: #687789;
  font-weight: 700;
}

.company-picker-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 25px;
  line-height: 1;
}

.company-picker-close:hover {
  background: #eff6ff;
}

.company-picker-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.company-picker-option {
  display: grid;
  min-height: 150px;
  place-items: center;
  gap: 8px;
  border: 2px solid #d8e0e8;
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
  color: #243246;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.company-picker-option:hover {
  border-color: #2b5f9f;
  background: #eff6ff;
}

.company-picker-option.is-selected {
  border-color: #2b5f9f;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(43, 95, 159, 0.12);
}

.company-picker-option img {
  display: block;
  width: min(100%, 220px);
  height: 76px;
  object-fit: contain;
}

.company-picker-option small {
  color: #2b5f9f;
  font-size: 12px;
  font-weight: 900;
}

.company-picker-admin {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #c5d4e7;
  border-radius: 12px;
  background: #f4f7fb;
  color: #243b59;
  text-align: left;
}
.company-picker-admin[hidden] { display: none; }
.company-picker-admin:hover, .company-picker-admin[aria-current="page"] { border-color: #2b5f9f; background: #eff6ff; }
.company-picker-admin:focus-visible { outline: 3px solid #93b7e5; outline-offset: 3px; }
.company-picker-admin-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px; background: #e2ebf7; color: #2b5f9f; }
.company-picker-admin-icon svg { width: 26px; height: 26px; }
.company-picker-admin-copy { display: grid; gap: 5px; flex: 1; min-width: 0; }
.company-picker-admin-copy strong { font-size: 16px; }
.company-picker-admin-copy small { color: #63758b; font-size: 12px; line-height: 1.4; }
.company-picker-admin-badge { border-radius: 20px; padding: 5px 9px; background: #e2ebf7; font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (max-width: 480px) { .company-picker-admin { gap: 9px; padding: 12px; } .company-picker-admin-badge { display: none; } }

body.is-company-picker-open {
  overflow: hidden;
}

.page-header h2,
.panel-head h3 {
  margin: 0;
}

.sheet-nav {
  display: grid;
  gap: 6px;
}

.sheet-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #eef4ff;
  text-align: left;
  white-space: nowrap;
}

.sheet-button:hover {
  background: var(--nav-hover);
}

.sheet-button.is-active {
  border-color: rgba(191, 219, 254, 0.2);
  background: var(--nav-active);
  font-weight: 800;
}

.sheet-nav-group {
  display: grid;
  gap: 5px;
}

.sheet-nav-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 4px;
}

.sheet-button-parent {
  min-width: 0;
}

.sheet-group-toggle {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd8ea;
  font-size: 15px;
}

.sheet-group-toggle:hover {
  background: var(--nav-hover);
}

.sheet-subnav {
  display: grid;
  gap: 4px;
  padding-left: 14px;
}

.sheet-subnav[hidden] {
  display: none;
}

.sheet-subbutton {
  min-height: 34px;
  padding-left: 18px;
  color: #d9e6f7;
  font-size: 13px;
}

.sidebar-frog-link {
  display: block;
  flex: 0 0 auto;
  width: 128px;
  max-width: calc(100% - 44px);
  margin: auto auto 0;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.sidebar-frog-link:focus-visible {
  outline: 2px solid rgba(238, 244, 255, 0.9);
  outline-offset: 4px;
}

.sidebar-frog {
  display: block;
  width: 100%;
  object-fit: contain;
}

.main {
  min-width: 0;
  padding: 26px 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.page-header h2 {
  flex: 0 0 auto;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

.line-memo-ticker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 420px;
  min-width: 0;
  max-width: none;
  height: 38px;
}

.line-memo-panel {
  position: relative;
  min-width: 0;
  height: 100%;
  border: 1px solid rgba(34, 197, 94, 0.38);
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg, #06140f 0%, #0d2a1d 45%, #06140f 100%);
  color: #dcfce7;
  box-shadow: inset 0 0 18px rgba(34, 197, 94, 0.22), 0 8px 22px rgba(15, 23, 42, 0.08);
}

.line-memo-panel-global {
  border-color: rgba(248, 113, 113, 0.52);
  background: linear-gradient(90deg, #210707 0%, #4a1212 45%, #210707 100%);
  box-shadow: inset 0 0 18px rgba(248, 113, 113, 0.24), 0 8px 22px rgba(15, 23, 42, 0.08);
}

.line-memo-ticker[hidden] {
  display: none;
}

.line-memo-ticker-single {
  grid-template-columns: minmax(0, 1fr);
}

.line-memo-panel::before,
.line-memo-panel::after {
  content: "";
  position: absolute;
  top: 0;
  z-index: 1;
  width: 56px;
  height: 100%;
  pointer-events: none;
}

.line-memo-panel::before {
  left: 0;
  background: linear-gradient(90deg, #06140f 0%, rgba(6, 20, 15, 0) 100%);
}

.line-memo-panel::after {
  right: 0;
  background: linear-gradient(270deg, #06140f 0%, rgba(6, 20, 15, 0) 100%);
}

.line-memo-panel-global::before {
  background: linear-gradient(90deg, #210707 0%, rgba(33, 7, 7, 0) 100%);
}

.line-memo-panel-global::after {
  background: linear-gradient(270deg, #210707 0%, rgba(33, 7, 7, 0) 100%);
}

.line-memo-track {
  display: inline-flex;
  align-items: center;
  gap: clamp(56px, 8vw, 140px);
  min-width: max-content;
  height: 100%;
  padding: 0 40px;
  animation: lineMemoScroll var(--memo-scroll-duration, 100s) linear infinite;
}

.line-memo-track span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: #dcfce7;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 8px rgba(134, 239, 172, 0.55);
}

.line-memo-track b {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  font-size: 12px;
  text-shadow: none;
}

.line-memo-panel-global .line-memo-track span {
  color: #fee2e2;
  text-shadow: 0 0 8px rgba(252, 165, 165, 0.58);
}

.line-memo-panel-global .line-memo-track b {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

@keyframes lineMemoScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.sync-status {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.sync-status.is-saving {
  color: #b45309;
}

.sync-status.is-live {
  color: #047857;
}

.sync-status.is-waiting {
  color: #0369a1;
}

.sync-status.is-offline {
  color: #b91c1c;
}

.page-logo {
  display: block;
  width: 220px;
  max-width: 26vw;
  height: 76px;
  object-fit: contain;
  object-position: right center;
}

.system-memo {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.system-memo[hidden] {
  display: none;
}

.system-board-memo {
  display: block;
}

.system-board-stack {
  display: grid;
  gap: 10px;
}

.system-board-ticker {
  position: relative;
  height: 54px;
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(90deg, #06140f 0%, #12351f 48%, #06140f 100%);
  box-shadow: inset 0 0 28px rgba(34, 197, 94, 0.22), 0 14px 34px rgba(15, 23, 42, 0.1);
}

.system-board-ticker-global {
  border-color: rgba(248, 113, 113, 0.52);
  background: linear-gradient(90deg, #210707 0%, #4a1212 48%, #210707 100%);
  box-shadow: inset 0 0 24px rgba(248, 113, 113, 0.24), 0 10px 26px rgba(15, 23, 42, 0.08);
}

.system-board-ticker::before,
.system-board-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  z-index: 1;
  width: 90px;
  height: 100%;
  pointer-events: none;
}

.system-board-ticker::before {
  left: 0;
  background: linear-gradient(90deg, #06140f 0%, rgba(6, 20, 15, 0) 100%);
}

.system-board-ticker::after {
  right: 0;
  background: linear-gradient(270deg, #06140f 0%, rgba(6, 20, 15, 0) 100%);
}

.system-board-ticker-global::before {
  background: linear-gradient(90deg, #210707 0%, rgba(33, 7, 7, 0) 100%);
}

.system-board-ticker-global::after {
  background: linear-gradient(270deg, #210707 0%, rgba(33, 7, 7, 0) 100%);
}

.system-board-track {
  display: inline-flex;
  align-items: center;
  gap: 96px;
  min-width: max-content;
  height: 100%;
  padding: 0 56px;
  animation: systemBoardScroll var(--memo-scroll-duration, 64s) linear infinite;
}

.system-board-track span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  color: #dcfce7;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(134, 239, 172, 0.6);
}

.system-board-track b {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  font-size: 16px;
  text-shadow: none;
}

.system-board-track .system-board-global {
  color: #fee2e2;
  text-shadow: 0 0 10px rgba(252, 165, 165, 0.6);
}

.system-board-track .system-board-global b {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

@keyframes systemBoardScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.admin-editor {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.admin-memo-card .memo-input {
  min-height: 120px;
  font-size: 20px;
}

.admin-global-card {
  grid-column: 1 / -1;
}

.admin-global-card .memo-title {
  background: #b42318;
}

.admin-global-card .memo-input {
  background: linear-gradient(180deg, #fff7f7 0%, #fffafa 100%);
  color: #c1121f;
  min-height: 96px;
  font-size: 24px;
}

.memo-card {
  overflow: hidden;
  border: 1px solid #d7e3cc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 35, 51, 0.07);
}

.memo-title {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  background: #4f9236;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.memo-input {
  display: block;
  width: 100%;
  min-height: 86px;
  border: 0;
  padding: 20px 18px;
  resize: vertical;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdf9 100%);
  color: #c90000;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
}

.memo-input:focus {
  outline: 3px solid rgba(43, 95, 159, 0.22);
  outline-offset: -3px;
}

.system-status {
  max-width: 1460px;
}

.system-status[hidden] {
  display: none;
}

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

.board-head h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.board-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.board-kpis {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.board-kpis span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #d8e0e8;
  border-radius: 999px;
  padding: 0 13px;
  background: #ffffff;
  color: #334155;
  font-weight: 800;
}

.status-rows {
  display: grid;
  gap: 10px;
}

.status-row {
  display: grid;
  grid-template-columns: 116px minmax(520px, 1.15fr) minmax(520px, 0.95fr);
  gap: 14px;
  align-items: center;
  min-height: 78px;
  border: 1px solid #d8e0e8;
  border-left: 5px solid #2b5f9f;
  border-radius: 8px;
  padding: 13px 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 35, 51, 0.06);
}

.line-label {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  background: #253143;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.job-main {
  display: grid;
  grid-template-columns: 130px 92px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.job-meta,
.job-name {
  display: grid;
  align-content: center;
  min-height: 52px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 12px;
}

.job-meta span,
.job-name span,
.process-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.job-meta strong,
.job-name strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.job-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-area {
  min-width: 0;
}

.process-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

.process-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 0 11px;
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  min-width: 0;
}

.process-box span:last-child {
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-box.process-paint-route {
  justify-content: center;
  border-color: #7c3aed;
  background: #f3e8ff;
  color: #5b21b6;
}

.process-box.process-paint-route span:last-child {
  text-align: center;
}

.process-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #2b4058;
  font-size: 18px;
  line-height: 1;
  position: relative;
}

.icon-play::before,
.icon-outline::before,
.icon-left::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.icon-play::before {
  border-left: 14px solid currentColor;
}

.icon-outline::before {
  border-left: 14px solid currentColor;
}

.icon-outline::after {
  content: "";
  position: absolute;
  left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #edfafa;
}

.icon-circle::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.icon-left::before {
  border-right: 14px solid currentColor;
}

.icon-square::before {
  content: "";
  width: 12px;
  height: 12px;
  background: currentColor;
}

.icon-corner::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-bottom: 20px solid currentColor;
}

.process-teal,
.process-teal-fill {
  color: #007d8a;
  background: #edfafa;
  border-color: #bce4e8;
}

.process-teal .process-icon,
.process-teal-fill .process-icon {
  color: #008a96;
}

.process-dark .process-icon {
  color: #2b4058;
}

.process-dark {
  background: #f0f5fb;
  border-color: #cddceb;
}

.process-brown .process-icon {
  color: #7a5432;
}

.process-brown {
  background: #fff5eb;
  border-color: #f0d2b8;
  color: #7a5432;
}

.process-green .process-icon {
  color: #0f8f2b;
}

.process-green {
  background: #edf8ef;
  border-color: #c8e8ce;
}

.process-dark-square .process-icon {
  color: #333333;
  font-size: 18px;
}

.process-dark-square {
  background: #f6f6f6;
  border-color: #d7d7d7;
}

.process-empty-hidden {
  visibility: hidden;
}

.process-empty {
  opacity: 0.42;
}

.list-editor {
  display: grid;
  gap: 14px;
}

.list-editor:has(.list-grid-wrap) {
  grid-template-rows: auto auto minmax(260px, 1fr);
  height: calc(100vh - 154px);
  min-height: 0;
}

.list-editor:has(.bch-grid-wrap) {
  grid-template-rows: auto auto minmax(260px, 1fr);
  height: calc(100vh - 154px);
  min-height: 0;
}

.list-editor:has(.order-grid-wrap),
.list-editor:has(.machine-repair-grid-wrap) {
  grid-template-rows: auto minmax(260px, 1fr);
  height: calc(100vh - 154px);
  min-height: 0;
}

.list-editor[hidden] {
  display: none;
}

.stock-editor[hidden] {
  display: none;
}

.stock-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 35, 51, 0.06);
}

.stock-head h3,
.stock-area-title h3,
.stock-area-title-input {
  margin: 0;
  font-size: 21px;
}

.stock-head p,
.stock-area-title p,
.stock-area-note-input {
  margin: 4px 0 0;
  color: var(--muted);
}

.stock-head-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stock-head-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #d8e0e8;
  border-radius: 999px;
  padding: 0 13px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.stock-calculator-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
}

.stock-calculator {
  width: min(320px, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.stock-calculator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #0f172a;
}

.stock-calculator-head strong {
  font-size: 15px;
  font-weight: 900;
}

.stock-calculator-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.stock-calculator-display {
  display: grid;
  gap: 2px;
  min-height: 48px;
  border: 1px solid #d8e0e8;
  border-radius: 6px;
  padding: 6px 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: right;
  overflow: hidden;
}

.stock-calculator-display span,
.stock-calculator-display strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-calculator-display span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.stock-calculator-display strong {
  font-size: 18px;
  font-weight: 900;
}

.stock-calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 6px;
}

.stock-calculator-key {
  min-width: 0;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1d3557;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.stock-calculator-key:hover,
.stock-calculator-key:focus-visible {
  border-color: #2c5f9e;
  outline: none;
}

.stock-calculator-key.is-clear,
.stock-calculator-key.is-equals {
  grid-column: span 2;
}

.stock-calculator-key.is-clear {
  color: #9f1239;
}

.stock-calculator-key.is-equals {
  background: #2c5f9e;
  border-color: #2c5f9e;
  color: #ffffff;
}

.stock-areas {
  display: grid;
  gap: 18px;
}

.stock-area {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(24, 35, 51, 0.07);
  overflow: hidden;
}

.stock-area-title {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  border-bottom: 3px solid #3d3d3d;
  padding: 16px 18px;
  background: #ffffff;
  text-align: center;
}

.stock-area-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.stock-groups {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 14px;
  align-items: start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.stock-group {
  flex: 0 0 auto;
  min-width: max-content;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.stock-area-title-input,
.stock-area-note-input,
.stock-group-title-input {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  box-sizing: border-box;
}

.stock-editor input[readonly] {
  cursor: default;
}

.stock-editor:not(.is-editing) .stock-area-title-input,
.stock-editor:not(.is-editing) .stock-area-note-input,
.stock-editor:not(.is-editing) .stock-group-title-input,
.stock-editor:not(.is-editing) .stock-item-input,
.stock-editor:not(.is-editing) .stock-code-input,
.stock-editor:not(.is-editing) .stock-count-input {
  pointer-events: none;
}

.stock-editor button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stock-editor:not(.is-editing) .stock-row-delete {
  display: none;
}

.stock-area-title-input {
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
}

.stock-area-note-input {
  background: #ffffff;
  color: #334155;
  font-size: 13px;
}

.stock-area-title-input:focus,
.stock-area-note-input:focus,
.stock-group-title-input:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: 2px;
  background: #ffffff;
  color: #0f172a;
}

.stock-group-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-bottom: 1px solid #d1d5db;
  background: #ffffff;
}

.stock-group-title-input {
  margin: 0;
  min-height: 36px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.stock-group-title-input {
  border: 0;
  border-radius: 0;
}

.stock-table {
  width: max-content;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 280px;
}

.stock-table th,
.stock-table td {
  border-right: 1px solid #9ca3af;
  border-bottom: 1px solid #9ca3af;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.stock-table th {
  height: 30px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.stock-table td {
  height: 28px;
  color: #0f172a;
  font-size: 13px;
}

.stock-table th:nth-child(1),
.stock-table td:nth-child(1) {
  min-width: 84px;
}

.stock-table th:nth-child(2),
.stock-table td:nth-child(2) {
  min-width: 92px;
}

.stock-table th:nth-child(3),
.stock-table td:nth-child(3) {
  min-width: 58px;
}

.stock-table th:nth-child(4),
.stock-table td:nth-child(4) {
  min-width: 126px;
}

.stock-cin7 {
  background: #ffff00;
  font-weight: 800;
}

.stock-count-wrap {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) 36px;
  align-items: stretch;
  width: 100%;
  min-width: max-content;
  height: 28px;
}

.stock-item-input,
.stock-code-input,
.stock-count-input {
  width: 100%;
  min-width: 100%;
  height: 28px;
  border: 0;
  padding: 0 6px;
  color: #0f172a;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  box-sizing: border-box;
  white-space: nowrap;
}

@supports (field-sizing: content) {
  .stock-item-input,
  .stock-code-input,
  .stock-count-input,
  .stock-group-title-input {
    width: auto;
    min-width: 100%;
    field-sizing: content;
  }
}

.stock-item-input {
  background: #ffffff;
  color: #334155;
}

.stock-code-input {
  background: #fffdf0;
  color: #334155;
}

.stock-count-input {
  background: #eef7ff;
}

.stock-item-input:focus,
.stock-code-input:focus,
.stock-count-input:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: -2px;
  background: #ffffff;
}

.stock-row-delete {
  position: static;
  align-self: center;
  justify-self: center;
  min-height: 22px;
  padding: 0 6px;
  font-size: 11px;
}

.stock-add-row {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-top: 1px solid #d1d5db;
  background: #f8fafc;
  color: #2b5f9f;
  font-weight: 800;
}

.stock-add-row:hover,
.stock-add-row:focus-visible {
  background: #eaf2ff;
  outline: none;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(24, 35, 51, 0.06);
}

.list-toolbar h3 {
  margin: 0;
  font-size: 21px;
}

.list-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.style-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(24, 35, 51, 0.05);
}

.selected-cell {
  display: flex;
  align-items: center;
  min-width: 190px;
  min-height: 30px;
  color: #334155;
  font-weight: 800;
  line-height: 1;
}

.list-selection-summary {
  min-width: 96px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.style-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.style-toolbar input[type="color"] {
  width: 34px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 2px;
  background: #ffffff;
}

.quick-colors {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-right: 4px;
}

.quick-color {
  width: 24px;
  height: 24px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  padding: 0;
  background: var(--swatch);
}

.quick-color:hover:not(:disabled),
.quick-color:focus-visible {
  outline: 2px solid #2b5f9f;
  outline-offset: 2px;
}

.quick-color:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.style-toolbar select {
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  line-height: 30px;
}

.style-button-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.style-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 10px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  line-height: 1;
}

.style-button.is-active {
  border-color: #2b5f9f;
  background: #eaf2ff;
  color: #2b5f9f;
}

.primary-action,
.secondary-action,
.danger-action,
.stock-delete-button,
.row-move,
.row-insert-above,
.row-delete {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
}

.primary-action {
  background: #2b5f9f;
  color: #ffffff;
}

.secondary-action {
  background: #f8fafc;
  color: #2b5f9f;
  border-color: #cbd5e1;
}

.auth-user {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  max-width: 220px;
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user[hidden],
#changePasswordButton[hidden],
.logout-link[hidden] {
  display: none;
}

.danger-action {
  background: #fff1f1;
  color: #b42318;
  border-color: #ffd1d1;
}

.stock-delete-button {
  min-height: 28px;
  margin-right: 6px;
  padding: 0 8px;
  background: #fff1f1;
  color: #b42318;
  border-color: #ffd1d1;
  font-size: 11px;
  white-space: nowrap;
}

.row-delete {
  min-height: 28px;
  padding: 0 8px;
  background: #f8fafc;
  color: #687789;
  border-color: #d8e0e8;
}

.row-move,
.row-insert-above {
  min-height: 22px;
  height: 22px;
  width: 22px;
  margin-right: 3px;
  padding: 0;
  background: #ffffff;
  color: #2b5f9f;
  border-color: #cbd5e1;
  font-size: 11px;
  line-height: 1;
}

.row-insert-above {
  font-size: 14px;
}

.row-action-cell {
  white-space: nowrap;
}

.row-select-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  white-space: nowrap;
}

.list-grid-wrap {
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(24, 35, 51, 0.08);
  height: 100%;
  min-height: 0;
}

.list-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.list-grid th,
.list-grid td {
  border-right: 1px solid #9ca3af;
  border-bottom: 1px solid #9ca3af;
  padding: 0;
  vertical-align: middle;
  white-space: normal;
}

.list-grid th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 36px;
  padding: 6px 8px;
  background: #3d3d3d;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.list-grid thead tr:nth-child(2) th {
  top: 36px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
}

.list-grid td.select-cell,
.list-grid th:first-child {
  position: sticky;
  left: 0;
  z-index: 6;
  background: #f8fafc;
}

.list-grid thead th:first-child {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 7;
  vertical-align: middle;
}

.list-grid--pinned-jobs th[data-list-column="debtor"],
.list-grid--pinned-jobs td[data-list-field-cell="debtor"] {
  position: sticky;
  left: var(--master-debtor-left, 86px);
}

.list-grid--pinned-jobs th[data-list-column="jobNo"],
.list-grid--pinned-jobs td[data-list-field-cell="jobNo"] {
  position: sticky;
  left: var(--master-job-left, 198px);
}

.list-grid--pinned-jobs th[data-list-column="cin7Reference"],
.list-grid--pinned-jobs td[data-list-field-cell="cin7Reference"] {
  position: sticky;
  left: var(--master-reference-left, 310px);
}

.list-grid--pinned-jobs th[data-list-column="jobName"],
.list-grid--pinned-jobs td[data-list-field-cell="jobName"] {
  position: sticky;
  left: var(--master-name-left, 284px);
}

.list-grid--pinned-jobs th:is([data-list-column="debtor"], [data-list-column="jobNo"], [data-list-column="cin7Reference"], [data-list-column="jobName"]) {
  z-index: 8;
  background: #3d3d3d;
}

.list-grid--pinned-jobs td:is([data-list-field-cell="debtor"], [data-list-field-cell="jobNo"], [data-list-field-cell="cin7Reference"], [data-list-field-cell="jobName"]) {
  z-index: 4;
  background-color: var(--cell-background, #ffffff);
}

.list-grid--pinned-jobs thead tr:nth-child(2) th {
  z-index: 2;
}

.list-grid--compact-pins th[data-list-column="jobName"] {
  left: auto;
  z-index: 3;
}

.list-grid--compact-pins td[data-list-field-cell="jobName"] {
  position: static;
}

.list-grid tbody tr:hover td {
  background-color: #f8fbff;
}

.list-grid tbody tr {
  height: 30px;
  max-height: 30px;
}

.list-grid tbody td {
  height: 30px;
  max-height: 30px;
  overflow: hidden;
  line-height: 1;
}

.list-grid tbody td.select-cell {
  overflow: visible;
}

.list-grid tbody tr.is-sent-to-run input,
.list-grid tbody tr.is-sent-to-run select {
  font-weight: 800;
}

.list-grid input,
.list-grid select,
.list-rich-text {
  display: block;
  width: 100%;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: #0f172a;
  text-align: center;
  font-size: 12px;
}

.list-rich-text {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  outline: none;
  white-space: pre-wrap;
  cursor: text;
}

.list-rich-text:focus {
  background: #ffffff;
}

.list-grid td.edit-cell.is-range-selected {
  background-color: #bfe9e5 !important;
  box-shadow: inset 0 0 0 2px #008a96;
}

.list-grid td.edit-cell.is-range-selected > input,
.list-grid td.edit-cell.is-range-selected > .list-rich-text,
.list-grid td.edit-cell.is-range-selected .job-name-note-cell {
  background: transparent !important;
}

.list-grid td.edit-cell.is-range-selected.is-selected {
  box-shadow: inset 0 0 0 3px #2b5f9f;
}

.list-grid input:focus,
.list-grid select:focus {
  outline: none;
  background: #ffffff;
}

.list-grid input[readonly] {
  background: #f8fafc;
  color: #334155;
  cursor: default;
}

.list-completed-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  padding: 0 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  text-align: center;
  cursor: not-allowed;
}

.list-completed-display strong {
  font-weight: 900;
}

.list-grid input[readonly]:focus {
  outline: none;
}

.date-display-input {
  cursor: pointer;
}

.list-grid input.list-locked-field {
  cursor: not-allowed;
}

.job-name-note-cell {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 30px;
}

.job-name-note-cell input {
  min-width: 0;
  flex: 1 1 auto;
}

.job-name-note-cell .list-rich-text {
  min-width: 0;
  flex: 1 1 auto;
}

.job-name-note-cell textarea {
  min-width: 0;
  flex: 1 1 auto;
}

.job-name-note-cell .main1-input {
  min-width: 0;
  flex: 1 1 auto;
}

.job-name-note-cell--bch {
  height: var(--bch-row-control-height, 48px);
  min-height: 48px;
}

.job-name-note-cell--bch .job-note-button {
  flex-basis: 44px;
  width: 44px;
  height: var(--bch-row-control-height, 48px);
  min-height: 48px;
  border: 1px solid #9ca3af;
  border-left: 0;
}

.job-note-button {
  flex: 0 0 34px;
  width: 34px;
  height: 30px;
  border: 0;
  border-left: 1px solid #cbd5e1;
  background: #2b5f9f;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.job-note-button.has-note {
  background: #9a5b00;
  color: #ffffff;
}

.job-note-button:focus-visible {
  outline: 2px solid #2b5f9f;
  outline-offset: -2px;
}

.order-grid-wrap {
  align-self: start;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(24, 35, 51, 0.08);
  height: 100%;
  min-height: 0;
}

.order-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.order-grid th,
.order-grid td {
  border-right: 1px solid #9ca3af;
  border-bottom: 1px solid #9ca3af;
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.order-title-row th {
  height: 34px;
  background: #3d3d3d;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
}

.order-title-row th:first-child,
.order-title-row th:last-child,
.order-field-row th:first-child,
.order-field-row th:last-child {
  background: #f8fafc;
}

.order-field-row th {
  height: 28px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 500;
}

.order-grid tbody td {
  height: 28px;
  max-height: 28px;
  line-height: 1;
}

.order-grid tbody tr:hover td {
  background-color: #f8fbff;
}

.order-grid input {
  display: block;
  width: 100%;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: #0f172a;
  text-align: center;
  font-size: 13px;
  line-height: 28px;
  box-sizing: border-box;
}

.order-grid input:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: -2px;
  background: #ffffff;
}

.order-cell:first-of-type input {
  font-weight: 600;
}

.order-grid .row-action-cell .row-delete {
  min-height: 24px;
  height: 24px;
  padding: 0 8px;
}

.global-date-picker {
  position: fixed;
  z-index: 9999;
  width: 1px;
  height: 1px;
  opacity: 0.01;
}

.select-cell,
.row-action-cell {
  text-align: center;
  vertical-align: middle;
  background: #f8fafc;
}

.select-cell input {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  margin: 0;
  vertical-align: middle;
}

.main-check-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  min-height: 30px;
  max-height: 30px;
}

.main-check-cell input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.line-assignment-labels {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #2b5f9f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.line-assignment-labels span {
  min-width: 14px;
  text-align: center;
}

.edit-cell.job-tone-green {
  background: #00f000;
}

.edit-cell.job-tone-yellow {
  background: #ffe066;
}

.edit-cell.job-tone-blue {
  background: #a9c5ef;
}

.edit-cell.job-tone-amber {
  background: #ffd966;
}

.edit-cell.job-tone-highlighter {
  background: #fff200;
}

.edit-cell.job-tone-pink {
  background: #d3a3bd;
}

.edit-cell.job-tone-plain {
  background: #ffffff;
}

.edit-cell.job-tone-green input,
.edit-cell.job-tone-yellow input,
.edit-cell.job-tone-blue input,
.edit-cell.job-tone-amber input,
.edit-cell.job-tone-highlighter input,
.edit-cell.job-tone-pink input {
  font-weight: 700;
}

.edit-cell.is-selected {
  box-shadow: inset 0 0 0 2px #2b5f9f;
}

.main1-editor {
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto auto auto minmax(260px, 1fr);
  height: calc(100vh - 154px);
  min-height: 0;
}

.main1-editor[hidden] {
  display: none;
}

.main1-current {
  border-top: 3px solid #3d3d3d;
  padding-top: 8px;
}

.main1-current-grid {
  display: grid;
  grid-template-columns: 140px 64px 380px 500px minmax(320px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.main1-head {
  display: grid;
  place-items: center;
  min-height: 40px;
  background: #3d3d3d;
  color: #ffffff;
  font-size: 16px;
  text-align: center;
}

.main1-monitor {
  display: grid;
  grid-row: span 2;
  place-items: center;
  border: 1px solid #ff2d2d;
  color: #d00000;
  font-size: 17px;
}

.main1-input {
  width: 100%;
  height: 30px;
  border: 1px solid #9ca3af;
  background: #ffffff;
  color: #263342;
  text-align: center;
  font-size: 12px;
  box-sizing: border-box;
  display: block;
  line-height: 1;
}

.main1-rich-text {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: pre-wrap;
  cursor: default;
}

select.main1-input {
  text-align-last: center;
  padding: 0 20px 0 6px;
}

.main1-input:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: -2px;
}

.main1-input[readonly],
.main1-input:disabled {
  background: #f8fafc;
  color: #1f2937;
  cursor: default;
  opacity: 1;
}

.main1-input.main1-locked-job-field {
  cursor: not-allowed;
}

.main1-input[readonly]:focus,
.main1-input:disabled:focus {
  outline: none;
}

.main1-input.date-display-input[readonly] {
  cursor: pointer;
}

.main1-input.is-selected {
  box-shadow: inset 0 0 0 2px #2b5f9f;
}

.main1-process-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.main1-process-cells.process-one {
  grid-template-columns: 1fr;
}

.main1-process-cells.process-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hdg-current-grid .main1-monitor {
  grid-row: auto;
  min-height: 24px;
  font-size: 14px;
}

.hdg-history-table th {
  height: 38px;
  font-size: 14px;
}

.main1-process-input {
  color: #008a96;
  font-size: 14px;
}

.paint-route-select,
.paint-route-select:disabled {
  min-width: 128px;
  color: #5b21b6;
  font-weight: 800;
}

.process-teal-text {
  color: #008a96;
}

.process-finish-text {
  color: #008a96;
  font-size: 14px;
}

.main1-monitor-input {
  display: none;
}

.main1-history-title {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid #ff2d2d;
  color: #d00000;
  background: #ffffff;
  font-size: 16px;
}

.main1-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(24, 35, 51, 0.05);
}

.main1-toolbar h3 {
  margin: 0;
  font-size: 18px;
}

.main1-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.main1-table-wrap {
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  height: 100%;
  min-height: 0;
}

.main1-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 8px 4px;
}

.main1-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 44px;
  background: #3d3d3d;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  line-height: 1.2;
  padding: 0 10px;
  box-sizing: border-box;
}

.main1-table .main1-subhead {
  top: 44px;
  height: 32px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
  line-height: 1;
}

.hdg-history-table .main1-subhead {
  top: 38px;
  height: 32px;
}

.main1-table td,
.main1-table th {
  border: 0;
}

.main1-table tbody tr {
  height: 38px;
}

.main1-table tbody td {
  height: 38px;
  padding: 0 4px;
  padding-top: 1px;
  padding-bottom: 1px;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.main1-table .select-cell,
.main1-table .row-action-cell {
  background: transparent;
}

.main1-table tr.is-on-monitor td,
.main1-table tr.is-on-monitor .main1-input {
  background: #00f000;
}

.main1-table tr.is-on-monitor .main1-input {
  font-weight: 800;
}

.main1-comment-input {
  text-align: center;
  padding-left: 0;
}

.sheet-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sheet-panel {
  padding: 16px;
}

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

.panel-head h3 {
  font-size: 18px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--blue);
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: calc(100vh - 250px);
  min-height: 340px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

td,
th {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  white-space: pre-wrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td:first-child,
th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 54px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

th:first-child {
  z-index: 3;
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.matched {
  background: #fff7df;
}

.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
}

.app-dialog {
  width: min(420px, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  color: var(--ink);
}

.app-dialog-title {
  padding: 16px 18px 4px;
  font-size: 16px;
  font-weight: 900;
}

.app-dialog-message {
  padding: 6px 18px 18px;
  color: #23364f;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.app-dialog-textarea {
  display: block;
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  color: #0f172a;
  font: inherit;
  line-height: 1.45;
}

.app-dialog-textarea:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: 1px;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.release-notes-dialog {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
}

.release-notes-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 0 18px 14px;
  color: #64748b;
  font-size: 13px;
}

.release-notes-meta strong {
  color: #334155;
}

.release-notes-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 14px;
}

.release-notes-content section {
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafc;
}

.release-notes-content section:only-child {
  grid-column: 1 / -1;
}

.release-notes-content h4 {
  margin: 0 0 8px;
  color: #1d3557;
  font-size: 15px;
}

.release-notes-content ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: #23364f;
  font-size: 14px;
  line-height: 1.45;
}

.release-notes-dismiss {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 14px;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.release-notes-dismiss input {
  width: 18px;
  height: 18px;
  margin: 0;
}

@media (max-width: 640px) {
  .release-notes-content {
    grid-template-columns: 1fr;
  }
}

.order-grid {
  width: max-content;
  min-width: 100%;
}

.order-grid th,
.order-grid td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

.order-grid tbody td {
  height: 28px;
  max-height: 28px;
  line-height: 1;
}

.order-grid input {
  display: block;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  line-height: 28px;
}

.bch-grid-wrap {
  align-self: start;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(24, 35, 51, 0.08);
  height: 100%;
  min-height: 0;
}

.bch-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.bch-grid th,
.bch-grid td {
  padding: 0;
  border-right: 8px solid #ffffff;
  border-bottom: 4px solid #ffffff;
  text-align: center;
  vertical-align: top;
  white-space: nowrap;
}

.bch-grid th:last-child,
.bch-grid td:last-child {
  border-right: 0;
}

.bch-grid tbody tr {
  --bch-row-control-height: 48px;
}

.bch-grid th {
  height: 44px;
  background: #3d3d3d;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  vertical-align: middle;
  line-height: 1.2;
  padding: 0 10px;
  box-sizing: border-box;
}

.bch-grid th:first-child,
.bch-grid th:last-child {
  background: #f8fafc;
}

.bch-job-input,
.bch-job-name-input {
  width: 100%;
  height: var(--bch-row-control-height, 48px);
  min-height: 48px;
  max-height: none;
  border: 1px solid #9ca3af;
  padding: 4px 8px;
  background: #ffffff;
  color: #263342;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  box-sizing: border-box;
  line-height: 1.2;
}

.bch-job-name-input {
  resize: none;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-align-last: center;
  align-content: center;
}

.bch-job-input:focus,
.bch-job-name-input:focus,
.bch-fitting-name:focus,
.bch-fitting-qty:focus,
.bch-status-select:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: -2px;
}

.bch-fittings-cell {
  min-width: 720px;
}

.bch-fitting-list {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.bch-fitting {
  width: 280px;
  height: 48px;
  border: 1px solid #9ca3af;
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
}

.bch-fitting-name {
  display: block;
  width: 100%;
  height: 23px;
  border: 0;
  border-bottom: 1px solid #9ca3af;
  padding: 0 8px;
  background: #666666;
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  line-height: 23px;
  box-sizing: border-box;
}

.bch-fitting-name::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.bch-fitting-bottom {
  display: grid;
  grid-template-columns: 100px 1fr 44px;
  height: 23px;
  min-height: 23px;
}

.bch-status-select,
.bch-fitting-qty {
  width: 100%;
  height: 23px;
  border: 0;
  border-right: 1px solid #9ca3af;
  padding: 0 4px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  line-height: 23px;
  box-sizing: border-box;
}

.bch-status-select {
  text-align: left;
}

.bch-fitting-qty {
  text-align: center;
  font-weight: 800;
}

.bch-fitting-delete {
  min-height: 23px;
  height: 23px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #f8fafc;
}

.bch-add-fitting {
  align-self: stretch;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  border-style: dashed;
  box-sizing: border-box;
}

.bch-job-input.is-selected,
.bch-job-name-input.is-selected,
.bch-fitting-name.is-selected,
.bch-status-select.is-selected,
.bch-fitting-qty.is-selected {
  box-shadow: inset 0 0 0 2px #2b5f9f;
}

.consumable-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  align-items: start;
  gap: 10px;
}

.consumable-table-card {
  display: grid;
  gap: 4px;
  align-self: start;
  min-width: 0;
}

.consumable-table-controls {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.consumable-table-controls button {
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.consumable-grid {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(24, 35, 51, 0.08);
}

.consumable-grid th,
.consumable-grid td {
  border: 1px solid #9ca3af;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

.consumable-grid th,
.consumable-grid th:first-child,
.consumable-grid td:first-child {
  position: static;
  width: auto;
  color: inherit;
  text-align: center;
}

.consumable-grid th {
  height: 34px;
  background: #666666;
}

.consumable-grid tbody td {
  height: 22px;
  max-height: 22px;
  line-height: 1;
}

.consumable-header-input,
.consumable-cell-input {
  display: block;
  width: 100%;
  border: 0;
  padding: 0 4px;
  background: #ffffff;
  color: #0f172a;
  text-align: center;
  font-size: 12px;
  box-sizing: border-box;
}

.consumable-header-input {
  height: 34px;
  min-height: 34px;
  background: #666666;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  font-style: italic;
  line-height: 34px;
}

.consumable-cell-input {
  height: 22px;
  min-height: 22px;
  line-height: 22px;
}

.consumable-header-input:focus,
.consumable-cell-input:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: -2px;
}

.consumable-header-input.is-selected,
.consumable-cell-input.is-selected {
  box-shadow: inset 0 0 0 2px #2b5f9f;
}

.consumable-grid .row-action-cell {
  background: #f8fafc;
}

.consumable-grid .row-action-cell .row-delete {
  min-height: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
}

.consumable-grid .row-action-cell .row-move {
  min-height: 20px;
  height: 20px;
  width: 20px;
  font-size: 10px;
}

@media (max-width: 1320px) {
  .consumable-board {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
  }
}

@media (max-width: 980px) {
  .consumable-board {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

@media (max-width: 640px) {
  .consumable-board {
    grid-template-columns: 1fr;
  }
}

.machine-repair-grid-wrap {
  align-self: start;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(24, 35, 51, 0.08);
  height: 100%;
  min-height: 0;
}

.machine-repair-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.machine-repair-grid th,
.machine-repair-grid td {
  border: 1px solid #9ca3af;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
}

.machine-repair-grid th {
  height: 44px;
  background: #3d3d3d;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.machine-repair-grid th:first-child,
.machine-repair-grid th:last-child {
  background: #f8fafc;
}

.machine-repair-grid tbody td {
  height: 28px;
  max-height: 28px;
  line-height: 1;
}

.machine-repair-grid tbody tr:hover td {
  background-color: #f8fbff;
}

.machine-repair-input {
  display: block;
  width: 100%;
  min-height: 28px;
  border: 0;
  padding: 0 8px;
  background: #ffffff;
  color: #0f172a;
  text-align: center;
  font-size: 13px;
  line-height: 28px;
  box-sizing: border-box;
}

.machine-repair-textarea {
  height: 28px;
  min-height: 28px;
  resize: vertical;
  line-height: 1.2;
  padding: 5px 8px;
}

.machine-repair-grid .date-display-input[readonly] {
  cursor: pointer;
}

.machine-repair-input:focus {
  outline: 2px solid #2b5f9f;
  outline-offset: -2px;
}

.machine-repair-grid .select-cell,
.machine-repair-grid .row-action-cell {
  background: #f8fafc;
}

.machine-repair-grid .row-action-cell .row-delete {
  min-height: 24px;
  height: 24px;
  padding: 0 8px;
}

.machine-repair-grid .row-action-cell .row-move {
  min-height: 24px;
  height: 24px;
}

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

  .sidebar {
    position: relative;
    height: auto;
    max-height: 46vh;
  }

  .brand {
    padding-top: 4px;
  }

  .system-memo {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .system-status {
    overflow-x: auto;
  }

  .status-row {
    min-width: 980px;
  }

  .stock-head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .stock-head-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

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

  .page-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .line-memo-ticker {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    flex-basis: auto;
    height: auto;
  }

  .line-memo-panel {
    height: 38px;
  }

  .page-logo {
    align-self: flex-start;
    width: 180px;
    max-width: 100%;
  }

  .page-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .stock-head {
    flex-direction: column;
  }

}

/* Readability baseline for shared dashboard tables. */
.list-grid th {
  height: 42px;
  padding: 7px 10px;
  font-size: 14px;
  line-height: 1.15;
}

.list-grid thead tr:nth-child(2) th {
  top: 42px;
  height: 36px;
  font-size: 13px;
  line-height: 1.15;
}

.list-grid tbody tr,
.list-grid tbody td {
  height: 36px;
  max-height: 36px;
  line-height: 1.15;
}

.list-grid input,
.list-grid select,
.list-rich-text,
.list-completed-display {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
}

.list-grid select {
  line-height: 36px;
}

.row-select-tools,
.main-check-cell {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
}

.job-name-note-cell {
  height: 36px;
}

.job-note-button {
  height: 36px;
  font-size: 12px;
}

.line-assignment-labels {
  font-size: 12px;
}

.selected-cell,
.style-toolbar label,
.list-selection-summary {
  font-size: 14px;
}

.style-toolbar select {
  font-size: 14px;
}

.main1-table .main1-subhead {
  height: 36px;
  font-size: 14px;
  line-height: 1.15;
}

.hdg-history-table .main1-subhead {
  top: 38px;
}

.main1-table tbody td {
  height: 38px;
  line-height: 1.15;
}

.main1-input,
.main1-process-input,
.process-finish-text {
  height: 38px;
  min-height: 38px;
  font-size: 14px;
  line-height: 1.15;
}

.order-grid tbody td,
.order-grid input,
.machine-repair-grid tbody td,
.machine-repair-input,
.machine-repair-textarea {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  font-size: 14px;
  line-height: 1.15;
}

.order-grid input,
.machine-repair-input {
  padding: 0 10px;
}

.bch-job-input,
.bch-job-name-input,
.bch-fitting-name,
.bch-fitting-qty,
.bch-status-select {
  font-size: 14px;
}

.stock-table th {
  height: 36px;
  font-size: 14px;
}

.stock-table td,
.stock-item-input,
.stock-code-input,
.stock-count-input,
.stock-count-wrap {
  height: 34px;
  min-height: 34px;
  font-size: 14px;
}

.stock-count-wrap {
  grid-template-columns: minmax(64px, 1fr) 40px;
}

.sheet-subbutton,
.auth-user,
.sync-status {
  font-size: 14px;
}

.line-memo-track b {
  font-size: 13px;
}

.activity-editor { display: grid; gap: 16px; }
.activity-editor[hidden] { display: none; }
.activity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.activity-head h3 { margin: 0 0 4px; font-size: 20px; }
.activity-head p { margin: 0; color: #64748b; }
.audit-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}
.audit-filters label { display: grid; gap: 5px; min-width: 0; }
.audit-filters label span { color: #475569; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.audit-filters input,
.audit-filters select {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
}
.audit-events { display: grid; gap: 9px; }
.audit-event {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #2f70b7;
  border-radius: 10px;
  background: #fff;
}
.audit-event summary {
  display: grid;
  grid-template-columns: 155px 130px minmax(170px, 220px) minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  list-style-position: inside;
  font-weight: 700;
}
.audit-event[open] summary { border-bottom: 1px solid #dbe3ed; background: #f8fafc; }
.audit-time,
.audit-count { color: #64748b; font-size: 13px; }
.audit-action {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f1fb;
  color: #24598f;
  font-size: 12px;
}
.audit-action--delete { background: #fee2e2; color: #991b1b; }
.audit-action--create,
.audit-action--completed,
.audit-action--stock-sync { background: #dcfce7; color: #166534; }
.audit-job { color: #334155; white-space: nowrap; }
.audit-event-detail { padding: 14px; }
.audit-event-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; color: #64748b; font-size: 13px; }
.audit-change-list { display: grid; gap: 10px; }
.audit-change { overflow: hidden; border: 1px solid #dbe3ed; border-radius: 8px; }
.audit-change header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 9px 11px; background: #f8fafc; }
.audit-change header span { color: #475569; }
.audit-change header code { margin-left: auto; color: #64748b; font-size: 11px; }
.audit-values { display: grid; grid-template-columns: 1fr 1fr; }
.audit-values > div { min-width: 0; padding: 10px; }
.audit-values > div + div { border-left: 1px solid #dbe3ed; background: #f8fffb; }
.audit-values label { display: block; margin-bottom: 6px; color: #64748b; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.audit-values pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #172033;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.audit-empty { color: #94a3b8; font-style: italic; }
.audit-message { padding: 18px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #475569; text-align: center; }
.audit-message--error { border-color: #fecaca; background: #fff7f7; color: #991b1b; }
.audit-load-more { justify-self: center; }

@media (max-width: 1300px) {
  .audit-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .audit-event summary { grid-template-columns: 145px 110px minmax(160px, 1fr) minmax(140px, 1fr); }
  .audit-job,
  .audit-count { display: none; }
}
/* Account permissions are deliberately separate from workbook/shared data. */
.account-admin-head { display: flex; gap: 20px; justify-content: space-between; align-items: center; }
.account-admin-editor { background: #fff; border: 1px solid #d5dde7; border-radius: 12px; padding: 24px; }
.account-admin-editor p { color: #526174; line-height: 1.6; }
.account-admin-editor button:disabled { opacity: .45; cursor: not-allowed; }
.account-admin-actions, .account-admin-row-actions, .account-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-delete-button { color: #b42318; border-color: #e8b1ac; }
.account-dialog { width: min(490px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; border: 1px solid #cbd5e1; border-radius: 14px; padding: 24px; color: #17202a; box-shadow: 0 24px 70px #0f172a4d; }
.account-dialog::backdrop { background: #0f18289e; }
.account-dialog h2 { margin: 0; font-size: 22px; }
.account-dialog p, .account-dialog small { color: #526174; line-height: 1.5; }
.account-dialog form > label { display: grid; gap: 6px; margin-top: 14px; font-weight: 600; }
.account-dialog input:not([type="checkbox"]), .account-dialog select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #b8c6d8; border-radius: 6px; font: inherit; }
.account-dialog fieldset { border: 1px solid #d5dde7; border-radius: 8px; margin: 16px 0; padding: 12px; }
.account-dialog .account-dialog-message { min-height: 24px; color: #17603b; }
.account-dialog .account-dialog-message.is-error, #accountCreateForm .account-dialog-message { color: #b42318; }
.account-dialog-actions { justify-content: flex-end; margin-top: 20px; }
.account-dialog button:disabled { opacity: .5; cursor: not-allowed; }
@media (min-width: 600px) {
  #accountCreateDialog { width: min(620px, calc(100vw - 32px)); }
  #accountCreateForm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  #accountCreateForm > h2, #accountCreateForm > p, #accountCreateForm > small, #accountCreateForm > fieldset, #accountCreateForm > .account-dialog-actions,
  #accountCreateForm > label:has(select) { grid-column: 1 / -1; }
  #accountCreateForm > label, #accountCreateForm > p, #accountCreateForm > fieldset, #accountCreateForm > .account-dialog-actions { margin: 0; }
}
.account-admin-guide { background: #eff6ff; border-left: 4px solid #37639c; padding: 16px 20px; margin-top: 20px; border-radius: 6px; }
.account-admin-guide p { margin-bottom: 0; }
.account-admin-message { min-height: 25px; color: #17603b !important; }
.account-admin-message.is-error { color: #b42318 !important; }
.account-admin-table-wrap { overflow-x: auto; }
.account-admin-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 14px; }
.account-admin-table th { background: #26384f; color: white; text-align: left; padding: 13px; }
.account-admin-table td { border-bottom: 1px solid #dce3ec; padding: 14px 12px; vertical-align: middle; }
.account-admin-table tr:nth-child(even) { background: #f7f9fc; }
.account-admin-table small { display: block; color: #607186; margin-top: 6px; max-width: 260px; }
.account-admin-table select { max-width: 230px; width: 100%; padding: 8px; border: 1px solid #b8c6d8; border-radius: 6px; background: white; color: #192c43; }
.account-company-options { display: flex; flex-wrap: wrap; gap: 12px; }
.account-company-roles { display: grid; gap: 10px; }
.account-company-role { display: grid; grid-template-columns: 125px minmax(0, 230px); align-items: center; gap: 12px; }
.account-company-role label { display: inline-flex; gap: 6px; align-items: center; }
.account-company-role select { min-width: 0; width: 100%; padding: 8px; border: 1px solid #b8c6d8; border-radius: 6px; background: white; color: #192c43; }
.account-company-role select:disabled { background: #f1f5f9; color: #64748b; }
.account-company-options label, .account-admin-table td > label { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.account-owner { display: inline-block; margin-top: 8px; color: #24589a; font-size: 12px; font-weight: 600; }
.account-admin-history { margin-top: 24px; }
.account-admin-history summary { cursor: pointer; font-weight: 700; }
.account-admin-history article { padding: 14px 0; border-bottom: 1px solid #dce3ec; font-size: 14px; }
.account-admin-history article p { margin: 6px 0 0; }
@media (max-width: 700px) { .account-admin-head { align-items: start; flex-direction: column; } .account-admin-editor { padding: 14px; } }

.cin7-reference-cell { display: flex; align-items: center; gap: 4px; padding: 3px; }
.list-grid .cin7-reference-cell input { min-width: 0; flex: 1; padding: 5px 3px; text-align: left; }
.cin7-reference-cell button { flex: none; border: 1px solid #b7cbe2; border-radius: 4px; background: #eff6ff; color: #28598f; padding: 5px 6px; font-size: 11px; cursor: pointer; }
.cin7-reference-cell button:disabled { color: #94a3b8; cursor: default; background: #f8fafc; }
.cin7-quotes-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 24px; border: 1px solid #d1dce9; border-radius: 14px; color: #172536; background: white; box-shadow: 0 18px 70px #0f172a40; }
.cin7-quotes-dialog::backdrop { background: #0f172a80; }
.cin7-quotes-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cin7-quotes-dialog h2 { margin: 0 0 6px; font-size: 23px; }
.cin7-quotes-dialog [data-quote-job] { margin: 0; color: #64748b; overflow-wrap: anywhere; }
.cin7-quotes-dialog button { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc; color: #245185; font: inherit; cursor: pointer; }
.cin7-quotes-toolbar { display: flex; align-items: center; gap: 16px; margin: 20px 0 10px; }
.cin7-quotes-toolbar strong { font-size: 20px; overflow-wrap: anywhere; }
.cin7-quotes-dialog [data-quote-status] { color: #476078; font-size: 14px; }
.cin7-quotes-dialog [data-quote-status].is-error { color: #b91c1c; }
.cin7-quotes-summary { display: flex; flex-wrap: wrap; gap: 14px 30px; padding: 16px; margin: 14px 0; background: #f1f5f9; border-radius: 8px; }
.cin7-quotes-summary[hidden], .cin7-quotes-table-wrap[hidden] { display: none; }
.cin7-quotes-summary dt { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.cin7-quotes-summary dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.cin7-quotes-table-wrap { max-height: 55vh; overflow: auto; border: 1px solid #d6dfeb; border-radius: 6px; }
.cin7-quotes-dialog table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.cin7-quotes-dialog th { position: sticky; top: 0; padding: 12px; background: #253d56; color: white; text-align: left; white-space: nowrap; z-index: 1; }
.cin7-quotes-dialog td { padding: 11px 12px; border-bottom: 1px solid #e2e8f0; vertical-align: top; overflow-wrap: anywhere; }
.cin7-quotes-dialog tr:nth-child(even) td { background: #f8fafc; }
.cin7-quotes-dialog small { display: block; margin-top: 4px; color: #64748b; font-size: 12px; }
.cin7-quotes-dialog .cin7-item-code { min-width: 130px; font-weight: 600; }
.cin7-quotes-dialog .cin7-item-quantity { text-align: right; min-width: 92px; font-variant-numeric: tabular-nums; }

.list-grid .cin7-match-button { flex: none; align-self: center; margin: 0 4px; border: 1px solid #b7cbe2; border-radius: 4px; background: #eff6ff; color: #28598f; padding: 5px 6px; font-size: 11px; cursor: pointer; }
.cin7-match-dialog { width: min(1050px, calc(100vw - 32px)); }
.cin7-match-dialog [data-match-job] { color: #64748b; margin: 0; }
.cin7-match-search { display: flex; align-items: end; gap: 12px; margin-top: 20px; }
.cin7-match-search label { display: grid; gap: 6px; flex: 1; font-size: 13px; }
.cin7-match-search input { width: 100%; min-width: 0; box-sizing: border-box; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: 15px; }
.cin7-match-results { display: grid; gap: 8px; max-height: 230px; overflow: auto; margin-bottom: 12px; }
.cin7-match-dialog .cin7-match-result { display: grid; gap: 5px; width: 100%; text-align: left; padding: 12px; }
.cin7-match-result span { color: #334155; overflow-wrap: anywhere; }
.cin7-match-dialog .cin7-match-result[aria-pressed="true"] { background: #eff6ff; border: 2px solid #2563eb; padding: 11px; }
.cin7-match-dialog h3 { margin: 18px 0 8px; }
.cin7-match-dialog [data-match-description] { overflow-wrap: anywhere; }
.cin7-match-changes { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.cin7-match-changes > div { display: grid; gap: 8px; padding: 12px 16px; min-width: 110px; background: #eff6ff; border-radius: 8px; }
.cin7-match-changes strong { color: #476078; font-size: 12px; }
.cin7-match-changes span { font-size: 19px; font-weight: 600; }
.cin7-match-dialog details summary { cursor: pointer; margin: 12px 0; }
.cin7-match-dialog details .cin7-quotes-table-wrap { max-height: 260px; }
.cin7-match-dialog details table { table-layout: fixed; min-width: 720px; }
.cin7-match-dialog details th:nth-child(1), .cin7-match-dialog details td:nth-child(1) { width: 45%; text-align: left; }
.cin7-match-dialog details th:nth-child(2), .cin7-match-dialog details td:nth-child(2),
.cin7-match-dialog details th:nth-child(3), .cin7-match-dialog details td:nth-child(3) { width: 14%; }
.cin7-match-dialog details th:nth-child(4), .cin7-match-dialog details td:nth-child(4) { width: 27%; }
.cin7-match-dialog .is-error, .cin7-match-item-error td:last-child { color: #b91c1c; }
.cin7-match-help, .cin7-match-dialog [data-match-warning] { color: #64748b; font-size: 13px; }
.cin7-match-dialog .cin7-match-apply { background: #245185; color: white; border-color: #245185; }
.cin7-match-dialog button:disabled { opacity: .5; cursor: default; }
