@font-face {
  font-family: Vanta;
  src: local("Inter"), local("Segoe UI");
}
* {
  box-sizing: border-box;
}
:root {
  --bg: #f3f4f0;
  --paper: #fff;
  --ink: #252d29;
  --muted: #7b827b;
  --line: #e2e5df;
  --accent: #44634c;
  --lime: #d8ebaa;
  --red: #ad5145;
  --sidebar: 210px;
}
body {
  margin: 0;
  font:
    13px Vanta,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  outline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
  padding: 6px 10px;
  white-space: nowrap;
  line-height: 1.4;
}
button:hover {
  background: #f0f3ed;
  border-color: #b8c4b6;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.primary:hover {
  background: var(--accent);
  color: white;
}
.quiet {
  border-color: transparent;
  background: transparent;
}
.small {
  padding: 3px 7px;
  font-size: 11px;
}
.danger {
  color: var(--red);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  padding: 7px 9px;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
}
input[type="number"] {
  width: 72px;
}
input[type="search"] {
  min-width: 220px;
}
textarea {
  resize: vertical;
  line-height: 1.7;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.9px;
  font-weight: 550;
}
h2 {
  font-size: 17px;
  font-weight: 550;
}
h3 {
  font-size: 13px;
  font-weight: 600;
}
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #dce0d7;
  background: #ecefe7;
  padding: 25px 13px 12px;
}
.brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 0 13px;
}
.brand span {
  color: #789451;
}
.brand-sub {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin: 7px 13px 30px;
  color: var(--muted);
}
.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7ddcf;
  padding: 10px;
  border-radius: 5px;
  margin: 0 0 25px;
}
.workspace-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  background: #d6e1c6;
  font-size: 12px;
}
.workspace small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.nav-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 14px 12px 7px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: none;
  border-color: transparent;
  padding: 8px 12px;
  font-size: 12px;
}
.nav button.active {
  background: #dce5cf;
  border-color: #d1ddc4;
  color: #274535;
}
.nav .sub {
  margin-left: 25px;
  font-size: 11px;
  padding: 6px 10px;
}
.nav-icon {
  width: 17px;
  font-size: 15px;
  opacity: 0.7;
}
.sidebar-bottom {
  margin-top: auto;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 7px 0;
  border-top: 1px solid #d7ddcf;
  margin-top: 20px;
}
.avatar {
  background: var(--ink);
  color: var(--lime);
  border-radius: 50%;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  font-size: 10px;
}
.profile small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main {
  min-width: 0;
}
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  font-size: 11px;
  color: var(--muted);
  background: #f8f9f5;
}
.topbar b {
  color: var(--ink);
  font-weight: 500;
}
.top-right {
  display: flex;
  gap: 15px;
  align-items: center;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #739853;
  margin-right: 6px;
}
.dot.warning {
  background: #bd9950;
}
.kbd {
  border: 1px solid #d9ddd3;
  border-bottom-width: 2px;
  border-radius: 3px;
  font: 10px monospace;
  padding: 2px 5px;
  color: var(--muted);
}
.content {
  padding: 29px 30px 18px;
  max-width: 1900px;
  margin: auto;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 9px;
  line-height: 1.6;
}
.actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  margin-bottom: 22px;
}
.metric {
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border: 0;
}
.metric-label {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.metric-value {
  font-size: 27px;
  letter-spacing: -1px;
  margin-top: 8px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.metric-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.metric.active .metric-value {
  color: var(--accent);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 11px;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  gap: 2px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 13px;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.tabs .count {
  font-size: 10px;
  margin-left: 5px;
  opacity: 0.7;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.panel-head {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 360px);
  min-height: 160px;
}
.grid {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 12px;
  white-space: nowrap;
}
.grid thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.grid th {
  font-size: 10px;
  text-align: left;
  font-weight: 500;
  background: #f5f7f2;
  color: #6f796e;
  height: 35px;
  border-bottom: 1px solid var(--line);
  padding: 0 13px;
  position: relative;
  user-select: none;
}
.grid th[draggable] {
  cursor: grab;
}
.grid th:hover {
  background: #e9efdf;
}
.grid td {
  border-bottom: 1px solid #edf0e9;
  padding: 9px 13px;
  height: 38px;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid tbody tr:last-child td {
  border-bottom: 0;
}
.grid tr:hover td {
  background: #f6f8f1;
}
.grid td.number {
  font-variant-numeric: tabular-nums;
  color: #64715e;
}
.grid .rownum {
  width: 44px;
  color: #a5afa0;
  text-align: right;
  font: 10px monospace;
}
.grid .domain {
  font-weight: 500;
}
.badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.2;
  background: #edf0eb;
  color: #65715f;
}
.badge.active,
.badge.ready {
  background: #e6efdd;
  color: #4a6a38;
}
.badge.lost {
  background: #f5e9e5;
  color: #a46b5d;
}
.badge.new {
  background: #edf0f5;
  color: #758293;
}
.badge.work {
  background: #faf0dd;
  color: #97733b;
}
.badge.brand {
  background: #eaf0e5;
  color: #687f55;
}
.mono {
  font-family: Consolas, monospace;
  font-size: 11px;
}
.muted {
  color: var(--muted);
}
.table-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  align-items: center;
}
.notice {
  border: 1px solid #dfe5d5;
  border-left: 3px solid #9aaf7c;
  background: #f1f5e9;
  padding: 10px 13px;
  border-radius: 3px;
  color: #657457;
  font-size: 11px;
  line-height: 1.6;
  margin: 16px 0;
}
.notice.warn {
  background: #faf5e9;
  border-color: #e9ddbe;
  color: #92793f;
}
.empty {
  padding: 50px 25px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 8px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 15px;
}
.field label {
  font-size: 11px;
  color: #687162;
}
.field small {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}
.form-panel {
  padding: 20px;
  max-width: 850px;
}
.import-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.import-col {
  min-width: 0;
}
.import-col textarea {
  width: 100%;
  height: 310px;
  font:
    11px/1.8 Consolas,
    monospace;
  white-space: pre;
  resize: vertical;
  background: #fcfdf9;
}
.import-col.error textarea {
  background: #fbf6f3;
  color: #a26c5d;
}
.import-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}
.import-title b {
  font-size: 12px;
}
.import-col .meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
}
.machine-layout {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  min-height: 470px;
}
.machine-nav {
  border-right: 1px solid var(--line);
  background: #f7f8f3;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 650px;
  overflow: auto;
}
.machine-nav button {
  font-size: 11px;
  text-align: left;
  border-color: transparent;
  background: none;
  padding: 7px 8px;
}
.machine-nav button.active {
  background: #e2eacb;
  color: #4d6638;
  border-color: #d7e2bc;
}
.machine-work {
  padding: 17px;
  min-width: 0;
}
.machine-columns {
  display: grid;
  grid-template-columns: repeat(var(--parts), minmax(170px, 1fr));
  gap: 10px;
  overflow-x: auto;
}
.machine-col {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.machine-col header {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f5f7f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.machine-col textarea {
  border: 0;
  border-radius: 0;
  width: 100%;
  height: 320px;
  resize: vertical;
  font:
    10px/1.9 Consolas,
    monospace;
  white-space: pre;
  padding: 10px;
  background: white;
}
.machine-col footer {
  padding: 7px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 4px;
  justify-content: space-between;
}
.parts {
  display: flex;
  gap: 7px;
  align-items: center;
}
.parts label {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 9px;
  background: white;
  font-size: 11px;
  cursor: pointer;
}
.parts label:has(input:checked) {
  background: #e7efd9;
  border-color: #c3d3aa;
}
.parts input {
  margin: 0 5px 0 0;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.settings-grid .panel {
  padding: 20px;
}
.checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 15px 0;
}
.checklist label {
  font-size: 11px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.doc-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.document-grid {
  min-height: 350px;
}
.document-grid td {
  min-width: 160px;
  max-width: none;
  padding: 0;
}
.document-grid input {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 9px 12px;
}
.document-grid input:focus {
  background: #eff5e6;
  outline: 1px solid #91ac71;
}
.document-grid .rownum {
  min-width: 40px;
  padding: 0 10px;
}
.login {
  max-width: 440px;
  margin: 15vh auto;
  background: white;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.login h1 {
  margin: 25px 0 15px;
}
.login p {
  line-height: 1.8;
  margin-bottom: 25px;
  color: var(--muted);
}
.boot {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25vh auto;
  justify-content: center;
  color: var(--muted);
}
.boot span {
  color: var(--accent);
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--ink);
  color: white;
  padding: 11px 17px;
  border-radius: 5px;
  box-shadow: 0 5px 24px #17251920;
  z-index: 100;
  max-width: 520px;
  display: none;
  font-size: 12px;
}
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: min(720px, 92vw);
  max-height: 85vh;
  box-shadow: 0 20px 90px #1a281b30;
}
dialog::backdrop {
  background: #202c2540;
  backdrop-filter: blur(3px);
}
.dialog-content {
  padding: 25px;
}
.dialog-content h2 {
  margin-bottom: 18px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.dialog-content textarea {
  width: 100%;
  min-height: 200px;
}
.stats-bars {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
}
.stat-bar {
  display: grid;
  grid-template-columns: 155px 1fr 60px;
  gap: 14px;
  align-items: center;
  font-size: 11px;
}
.bar-track {
  height: 7px;
  background: #edf1e7;
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: #a4bd7d;
}
.resize {
  position: absolute;
  right: 0;
  top: 0;
  width: 7px;
  height: 100%;
  cursor: col-resize;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-note {
  font-size: 10px;
  color: #969e90;
  margin: 13px 0;
  display: flex;
  justify-content: space-between;
}
.section-gap {
  margin-top: 20px;
}
.sortmark {
  font-size: 9px;
  margin-left: 5px;
}
.selected-cell {
  background: #e3edce !important;
}
#globalSearch {
  width: 170px;
  min-width: 0;
  padding: 4px 8px;
  background: transparent;
  font-size: 11px;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tab-btn {
  color: var(--muted);
}
.collab {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
}
.toggle-sidebar {
  display: none;
}
.template-json {
  font:
    11px/1.7 Consolas,
    monospace;
  width: 100%;
  height: 330px;
}
.block-link {
  display: block;
  padding: 8px 0;
}
.inline-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}
.search-empty {
  padding: 35px;
  color: var(--muted);
}
@media (min-width: 1600px) {
  .content {
    padding: 34px 38px;
  }
  .grid td {
    height: 40px;
  }
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 175px;
  }
  .content {
    padding: 22px 18px;
  }
  .topbar {
    padding: 0 18px;
  }
  .import-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .machine-columns {
    grid-template-columns: repeat(var(--parts), minmax(200px, 1fr));
  }
  .metric {
    padding: 14px;
  }
  .metric-value {
    font-size: 23px;
  }
}
@media (max-width: 700px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    padding: 0 12px;
  }
  .top-right .kbd,
  .top-right input {
    display: none;
  }
  .content {
    padding: 18px 12px;
  }
  .page-header {
    flex-wrap: wrap;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric:nth-child(2) {
    border-right: 0;
  }
  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .import-grid,
  .split {
    grid-template-columns: 1fr;
  }
  .machine-layout {
    grid-template-columns: 78px minmax(0, 1fr);
  }
  .table-scroll {
    max-height: 60vh;
  }
  .checklist {
    grid-template-columns: 1fr;
  }
  .toggle-sidebar {
    display: block;
  }
  .shell.mobile-nav .sidebar {
    display: flex;
    position: fixed;
    width: 210px;
    z-index: 20;
    box-shadow: 10px 0 40px #0002;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.grid th[data-col] {
  cursor: grab;
  touch-action: none;
}
.grid th.drag-target {
  background: #d8e5c4;
  box-shadow: inset 3px 0 #6e8d50;
}

/* Dense workspace: reserve the viewport for data, with personal display settings. */
:root {
  --ui-font: 13px;
  --table-font: 12px;
}
body {
  font-size: var(--ui-font);
}
.main {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 36px;
  min-height: 36px;
  padding: 0 18px;
  flex-shrink: 0;
}
.content {
  width: 100%;
  max-width: none;
  padding: 12px 18px 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.content > * {
  flex-shrink: 0;
}
.page-header {
  margin-bottom: 10px;
  align-items: center;
  min-height: 30px;
  gap: 10px;
}
.title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.title-line h1 {
  font-size: calc(var(--ui-font) + 6px);
  letter-spacing: -0.45px;
  line-height: 1.3;
}
.header-info {
  padding: 2px 5px;
  color: var(--muted);
}
.tabs {
  margin-bottom: 8px;
}
.tabs button {
  padding: 6px 10px;
}
.toolbar {
  margin-bottom: 8px;
  min-height: 30px;
}
.toolbar input,
.toolbar select {
  padding: 5px 8px;
}
.footer-note {
  margin: 7px 0 0;
}
.metrics {
  margin-bottom: 12px;
}
.metric {
  padding: 9px 14px;
}
.metric-value {
  font-size: 22px;
  margin-top: 4px;
}
.metric-note {
  margin-top: 2px;
}
.notice {
  margin: 9px 0;
  padding: 7px 10px;
}
.grid {
  font-size: var(--table-font);
}
.grid th {
  height: 29px;
  font-size: calc(var(--table-font) - 1px);
  padding: 0 10px;
}
.grid td {
  height: 30px;
  padding: 5px 10px;
}
.grid .domain {
  font-size: inherit;
}
.badge {
  font-size: inherit;
  line-height: 1.25;
  padding: 1px 4px;
  font-weight: 500;
  letter-spacing: normal;
}
.badge.brand {
  letter-spacing: normal;
  font-size: inherit;
  font-weight: 500;
}
body[data-coloring="text"] .badge {
  background: transparent;
  padding: 0;
}
body[data-coloring="text"] .badge.work {
  color: #8b631d;
}
body[data-coloring="text"] .badge.ready,
body[data-coloring="text"] .badge.active {
  color: #3e6e32;
}
body[data-coloring="text"] .badge.lost {
  color: #a34b3b;
}
body[data-density="comfortable"] .grid td {
  height: 39px;
  padding: 9px 12px;
}
body[data-density="compact"] .grid td {
  height: 29px;
  padding: 4px 10px;
}
.content > #tasksTable,
.content > #teamTable,
.content > #auditTable,
.content > .panel:has(> #baseTable),
.content > .panel:has(> #docList) {
  flex: 1;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#baseTable,
#docList {
  flex: 1;
  min-height: 0;
}
#tasksTable > .table-scroll,
#teamTable > .table-scroll,
#auditTable > .table-scroll,
#baseTable > .table-scroll,
#docList > .table-scroll {
  height: 100%;
  max-height: none;
  min-height: 0;
  flex: 1;
}
.content > .document-grid {
  flex: 1;
  min-height: 160px;
  max-height: none;
}
.table-footer {
  flex-shrink: 0;
  padding: 7px 10px;
}
.appearance-preview {
  display: flex;
  gap: 20px;
  border: 1px solid var(--line);
  padding: 12px;
  font-size: var(--table-font);
  background: #f9fbf6;
  border-radius: 4px;
}
.trash-list {
  max-height: 50vh;
  overflow: auto;
}
.trash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.trash-item small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
@media (max-width: 700px) {
  .content {
    padding: 10px;
  }
  .topbar {
    padding: 0 10px;
  }
  .page-header {
    align-items: flex-start;
  }
  .title-line h1 {
    font-size: 18px;
  }
  .metric {
    padding: 8px;
  }
  .top-right {
    gap: 6px;
  }
  .crumb {
    gap: 5px;
  }
  .topbar .crumb > span:first-of-type {
    display: none;
  }
  .content > #tasksTable,
  .content > #teamTable,
  .content > #auditTable,
  .content > .panel:has(> #baseTable) {
    min-height: 220px;
  }
}
