:root {
  color-scheme: light;
  --bg: #eef1ee;
  --surface: #fbfcf8;
  --surface-strong: #e3efe9;
  --ink: #1f2825;
  --muted: #65706b;
  --line: #cbd4cc;
  --accent: #1f6f73;
  --accent-soft: #d8ebea;
  --green: #4f7046;
  --red: #9d3d35;
  --gold: #aa7726;
  --shadow: 0 18px 50px rgba(31, 40, 37, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(31, 111, 115, 0.13), transparent 34%),
    linear-gradient(225deg, rgba(79, 112, 70, 0.11), transparent 38%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  padding: 10px 11px;
  outline-color: var(--accent);
}

textarea {
  resize: vertical;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
  max-width: 1500px;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 190px;
  border-radius: 8px;
  padding: 24px;
  color: #fbfcf8;
  background:
    linear-gradient(rgba(38, 30, 22, 0.12), rgba(38, 30, 22, 0.7)),
    repeating-linear-gradient(92deg, #6d4827 0 18px, #7c5631 18px 30px, #5d3b21 30px 48px);
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 620px;
  margin: 14px 0 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.tab {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(251, 252, 248, 0.72);
  border: 1px solid var(--line);
  font-weight: 500;
}

.tab.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 16px;
}

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

.model-card {
  display: grid;
  gap: 8px;
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow);
}

.model-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 115, 0.16), var(--shadow);
}

.model-card strong {
  font-size: 1rem;
}

.model-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.model-card .model-code {
  color: var(--accent);
  font-weight: 500;
}

.model-detail {
  display: grid;
  gap: 16px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
}

.sidebar,
.main-area {
  display: grid;
  align-content: start;
  gap: 16px;
}

.brand-block {
  min-height: 180px;
  border-radius: 8px;
  padding: 24px;
  color: #fbfcf8;
  background:
    linear-gradient(rgba(38, 30, 22, 0.2), rgba(38, 30, 22, 0.68)),
    repeating-linear-gradient(92deg, #6d4827 0 18px, #7c5631 18px 30px, #5d3b21 30px 48px);
  box-shadow: var(--shadow);
}

.brand-block h1 {
  max-width: 290px;
  margin: 18px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

.eyebrow.muted {
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 248, 0.88);
  box-shadow: var(--shadow);
  padding: 18px;
}

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

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

.section-title h2,
.topline h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 8px;
  background: rgba(251, 252, 248, 0.76);
  border: 1px solid var(--line);
  padding: 18px;
}

.topline .eyebrow {
  color: var(--muted);
  margin-bottom: 6px;
}

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

.icon-button,
.ghost-button,
.danger-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  font-weight: 500;
}

.icon-button {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.danger-button {
  color: #fff;
  background: var(--red);
  border-color: transparent;
}

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

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

.daily-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 14px;
}

.daily-summary span {
  color: var(--muted);
  font-size: 0.84rem;
}

.daily-summary strong {
  display: block;
  margin-top: 10px;
  font-size: 1.6rem;
}

.daily-summary small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.metrics article {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
  min-height: 104px;
}

.metrics span,
.muted-value {
  color: var(--muted);
  font-size: 0.84rem;
}

.metrics strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1;
  letter-spacing: 0;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.resource-list,
.operations,
.norms,
.cost-bars {
  display: grid;
  gap: 10px;
}

.resource-row,
.operation-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  padding: 12px;
}

.operation-row {
  grid-template-columns: 1.2fr 100px 0.7fr;
}

.resource-name,
.operation-name {
  font-weight: 500;
}

.resource-note,
.operation-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.status-pill {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 500;
}

.status-pill.warn {
  color: var(--red);
  background: rgba(157, 61, 53, 0.12);
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(36, 33, 29, 0.08);
}

.bar-fill {
  height: 100%;
  width: var(--bar-width);
  border-radius: inherit;
  background: var(--bar-color);
}

.norms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stock-panel,
.bot-panel {
  max-width: 1180px;
}

.compact-title {
  margin-top: 8px;
}

.mix-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 14px;
}

.mix-card h2 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.material-blocks {
  display: grid;
  gap: 14px;
}

.phase-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  padding: 14px;
}

.phase-block .section-title {
  margin-bottom: 0;
}

.phase-block h2 {
  font-size: 1.18rem;
}

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

.material-block {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 14px;
}

.material-block span,
.material-block small {
  color: var(--muted);
}

.material-block small {
  display: grid;
  gap: 6px;
  line-height: 1.35;
}

.material-block strong {
  font-size: 1.08rem;
}

.purchase-line {
  display: grid;
  gap: 2px;
}

.purchase-line b {
  color: var(--ink);
  font-weight: 600;
}

.purchase-line em {
  color: var(--muted);
  font-style: normal;
}

.purchase-total {
  color: var(--ink);
  font-weight: 700;
}

.mix-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.oak-purchase-grid {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.mix-total {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.mix-total span {
  color: var(--muted);
  font-size: 0.84rem;
}

.purchase-table {
  min-width: 920px;
}

.purchase-table th:nth-child(2),
.purchase-table td:nth-child(2) {
  white-space: normal;
  min-width: 320px;
}

.bot-panel {
  display: grid;
  gap: 18px;
}

.bot-steps {
  display: grid;
  gap: 8px;
}

.bot-steps code {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  padding: 12px;
  overflow-x: auto;
}

/* Заказы и склад */
.accounting-grid { align-items: start; }
.receipt-items { display: grid; gap: 8px; }
.receipt-item-row { display: grid; grid-template-columns: 2fr 1.1fr 1fr 1fr 34px; gap: 8px; align-items: center; }
.remove-row { border: 0; background: transparent; color: var(--red); font-size: 24px; cursor: pointer; }
.inventory-list, .receipt-log, .order-list { display: grid; gap: 10px; }
.inventory-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.inventory-row:last-child { border-bottom: 0; }
.inventory-row div:last-child { text-align: right; }
.inventory-row strong, .inventory-row span, .receipt-card strong, .receipt-card span { display: block; }
.inventory-row span, .receipt-card span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.inventory-row.is-empty strong { color: var(--red); }
.receipt-card { display: grid; grid-template-columns: minmax(180px, .8fr) 2fr; gap: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.order-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); }
.order-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.order-card-main, .order-metrics, .order-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.order-card h3 { margin: 5px 0 4px; font-size: 18px; }
.order-card p { margin: 0; color: var(--muted); font-size: 14px; }
.order-number { color: var(--accent); font-weight: 700; font-size: 13px; }
.order-status { border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-new { background: #e8edf5; color: #42526e; }
.status-in_progress { background: #fff1c8; color: #805b00; }
.status-done { background: #dff4e6; color: #22733d; }
.status-cancelled { background: #fde5e3; color: #a33a34; }
.order-metrics { justify-content: flex-start; flex-wrap: wrap; margin: 15px 0; color: var(--muted); font-size: 13px; }
.order-metrics span { padding-right: 13px; border-right: 1px solid var(--line); }
.order-metrics span:last-child { border: 0; }
.order-metrics b { color: var(--ink); }
.order-actions { justify-content: flex-start; }
.usage-log { display: grid; gap: 7px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.usage-log div { display: flex; justify-content: space-between; gap: 12px; }
.usage-log b { color: var(--ink); }

@media (max-width: 720px) {
  .receipt-item-row { grid-template-columns: 1fr 1fr; }
  .receipt-item-row .remove-row { grid-column: 2; justify-self: end; }
  .receipt-card { grid-template-columns: 1fr; }
  .inventory-row, .order-card-main, .usage-log div { align-items: flex-start; flex-direction: column; }
  .inventory-row div:last-child { text-align: left; }
}

.plain-note {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: min(100%, 420px); padding: 32px; }
.login-card h1 { margin: 6px 0 10px; }
.login-card form { margin-top: 28px; }
.login-error { min-height: 20px; margin: 0; color: var(--red); font-size: 14px; }

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

.empty-row td {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1120px) {
  .model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .brand-block {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

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

  .sidebar,
  .metrics,
  .daily-summary,
  .field-grid,
  .field-grid.three,
  .material-block-grid,
  .mix-grid,
  .norms {
    grid-template-columns: 1fr;
  }

  .topline {
    align-items: stretch;
    flex-direction: column;
  }

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

/* MOKU JOINERY — quiet, architectural identity */
:root {
  --bg: #e8e5df;
  --surface: #f8f6f1;
  --surface-strong: #eeebe4;
  --ink: #0d0d0d;
  --muted: #77736d;
  --line: #d5d0c8;
  --accent: #0d0d0d;
  --accent-soft: #e0ddd6;
}

body { background: var(--bg); }

.hero {
  min-height: 286px;
  align-items: flex-end;
  color: var(--ink);
  background: #f1eee8;
  border: 1px solid #ddd8cf;
}

.hero::after {
  background:
    linear-gradient(90deg, transparent 0 73%, rgba(13,13,13,.045) 73% 73.15%, transparent 73.15%),
    linear-gradient(180deg, transparent 0 86%, rgba(13,13,13,.045) 86% 86.35%, transparent 86.35%);
}

.brand-intro { display: grid; gap: 38px; }
.brand-lockup { display: grid; gap: 12px; color: #0d0d0d; }
.brand-name {
  display: block;
  font-size: clamp(2.35rem, 5.1vw, 5.25rem);
  font-weight: 400;
  letter-spacing: .42em;
  line-height: .72;
  margin-right: -.42em;
}
.brand-subtitle {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4f4c47;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .48em;
  line-height: 1;
  margin-right: -.48em;
}
.brand-subtitle::before,
.brand-subtitle::after { content: ""; width: 38px; height: 1px; background: currentColor; opacity: .5; }

.hero h1 {
  max-width: none;
  margin: 0;
  color: #0d0d0d;
  font-size: clamp(1.3rem, 2.3vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1;
}

.hero .ghost-button,
.hero .danger-button {
  color: #0d0d0d;
  border-color: #aaa59d;
  background: transparent;
}
.hero .ghost-button:hover,
.hero .danger-button:hover { color: #f8f6f1; border-color: #0d0d0d; background: #0d0d0d; }

.tabs { border-bottom-color: #c9c4bc; }
.tab { color: #77736d; }
.tab:hover { background: #dfdcd5; color: #0d0d0d; }
.tab.is-active { background: #0d0d0d; }

.panel,
.topline,
.daily-summary article,
.metrics article,
.model-card,
.resource-row,
.operation-row,
.mix-card,
.material-block,
.phase-block,
.mix-total,
.receipt-card,
.order-card { background: var(--surface); }

.model-card:hover,
.resource-row:hover,
.operation-row:hover { background: #efede7; }
.model-card.is-active { background: #0d0d0d; }

.login-page { background: #171717; }
.login-card { border-color: #f8f6f1; background: #f1eee8; }
.login-card .brand-lockup { margin-bottom: 25px; }
.login-card .brand-name { font-size: 3.1rem; }
.login-card h1 { color: #0d0d0d; }
.login-card .ghost-button { background: #0d0d0d; }

/* Focused MOKU sign-in */
.login-page { background: #343434; }
.login-card {
  width: min(100%, 380px);
  padding: 42px 34px 34px;
  border: 0;
  background: #f4f2ed;
}
.login-wordmark {
  margin: 0 0 42px;
  color: #0d0d0d;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
  justify-items: center;
  text-align: center;
}
.login-wordmark .brand-name {
  font-size: 3.8rem;
  letter-spacing: .32em;
  margin-right: -.32em;
}
.login-wordmark .brand-subtitle {
  font-size: .64rem;
  letter-spacing: .38em;
  margin-right: -.38em;
}
.login-wordmark .brand-subtitle::before,
.login-wordmark .brand-subtitle::after { width: 32px; }
.login-card form { gap: 18px; }
.login-submit {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 0;
  color: #f4f2ed;
  background: #2e2e2e;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background 140ms ease;
}
.login-submit:hover { background: #4a4a4a; }

@media (max-width: 760px) {
  .hero { min-height: 230px; padding: 22px; }
  .brand-intro { gap: 28px; }
  .brand-name { font-size: 2.55rem; letter-spacing: .29em; margin-right: -.29em; }
  .brand-subtitle { font-size: .62rem; letter-spacing: .32em; margin-right: -.32em; }
  .brand-subtitle::before, .brand-subtitle::after { width: 25px; }
}

/* Direction 2026: restrained monochrome atelier */
:root {
  color-scheme: light;
  --bg: #ececec;
  --surface: #ffffff;
  --surface-strong: #f2f2f2;
  --ink: #111111;
  --muted: #717171;
  --line: #d7d7d7;
  --accent: #111111;
  --accent-soft: #e7e7e7;
  --green: #1f1f1f;
  --red: #111111;
  --gold: #515151;
  --shadow: none;
}

body {
  background: var(--bg);
  font-family: "Arial Nova", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea { border-radius: 2px; }

input,
select,
textarea {
  border-color: #c9c9c9;
  background: #fff;
  padding: 11px 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 2px #111;
  outline: 0;
}

label {
  color: #595959;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-shell { max-width: 1600px; padding: 18px; }

.hero {
  min-height: 240px;
  border-radius: 0;
  padding: 28px;
  color: #fff;
  background: #111;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 58%, rgba(255,255,255,.055) 58% 59%, transparent 59%);
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.4rem, 5.8vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: .88;
}

.eyebrow { font-weight: 700; letter-spacing: .16em; }
.eyebrow.muted { color: #737373; }

.hero .ghost-button,
.hero .danger-button {
  color: #fff;
  background: transparent;
  border-color: #6a6a6a;
}

.hero .ghost-button:hover,
.hero .danger-button:hover { background: #fff; color: #111; border-color: #fff; }

.tabs { gap: 0; margin: 0 0 18px; border-bottom: 1px solid #bdbdbd; }

.tab {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  padding: 0 18px;
  color: #696969;
  background: transparent;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.tab:hover { color: #111; background: #e2e2e2; }
.tab.is-active { color: #fff; background: #111; border: 0; }

.panel,
.topline,
.daily-summary article,
.metrics article,
.model-card,
.resource-row,
.operation-row,
.mix-card,
.material-block,
.phase-block,
.mix-total,
.receipt-card,
.order-card {
  border-radius: 0;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.panel { padding: 20px; }
.section-title h2, .topline h2 { font-size: 1rem; font-weight: 700; letter-spacing: -.03em; }

.ghost-button,
.danger-button,
.icon-button {
  min-height: 40px;
  border-radius: 0;
  border-color: #111;
  background: #fff;
  color: #111;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  transition: background 140ms ease, color 140ms ease;
}

.ghost-button:hover,
.danger-button:hover { background: #111; color: #fff; }
.danger-button { border-color: #111; }
.icon-button { background: #111; color: #fff; }
.icon-button:hover { background: #505050; }

.model-grid { gap: 0; border: 1px solid var(--line); border-right: 0; }
.model-card { min-height: 168px; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 16px; }
.model-card:hover { background: #f4f4f4; }
.model-card.is-active { background: #111; color: #fff; box-shadow: none; outline: 0; }
.model-card.is-active span, .model-card.is-active .model-code { color: #bdbdbd; }
.model-card .model-code { color: #111; font-weight: 700; letter-spacing: .08em; }

.metrics, .daily-summary { gap: 0; border: 1px solid var(--line); }
.metrics article, .daily-summary article { min-height: 112px; border: 0; border-right: 1px solid var(--line); padding: 18px; }
.metrics article:last-child, .daily-summary article:last-child { border-right: 0; }
.metrics strong { font-weight: 500; letter-spacing: -.065em; }

.resource-row, .operation-row { border-radius: 0; background: #fafafa; }
.resource-row:hover, .operation-row:hover { background: #f3f3f3; }
.status-pill { border-radius: 0; background: #e5e5e5; color: #111; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.status-pill.warn { color: #111; background: #cbcbcb; }
.bar-track { height: 8px; border-radius: 0; background: #e2e2e2; }
.bar-fill { border-radius: 0; }

.phase-block { border-left: 2px solid #111; }
.material-block-grid { gap: 0; border: 1px solid var(--line); }
.material-block { border: 0; border-right: 1px solid var(--line); border-radius: 0; }

.order-card { border-radius: 0; padding: 18px; }
.order-card.is-selected { border-color: #111; box-shadow: inset 3px 0 0 #111; }
.order-number { color: #111; letter-spacing: .08em; }
.order-status, .status-new, .status-in_progress, .status-done, .status-cancelled {
  border-radius: 0;
  color: #111;
  background: #e9e9e9;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-in_progress { background: #cecece; }
.status-done { background: #111; color: #fff; }
.status-cancelled { background: #777; color: #fff; }

.inventory-row { padding: 16px 0; }
.receipt-card { border-radius: 0; }
.receipt-item-row { gap: 6px; }
.remove-row { color: #111; }

.login-page { background: #111; }
.login-card { width: min(100%, 440px); padding: 34px; border: 1px solid #fff; }
.login-card .eyebrow { color: #111; }
.login-card h1 { max-width: 320px; font-size: 2.35rem; font-weight: 500; letter-spacing: -.07em; line-height: .92; }
.login-card .ghost-button { margin-top: 4px; background: #111; color: #fff; }
.login-card .ghost-button:hover { background: #4c4c4c; }

@media (max-width: 760px) {
  .app-shell { padding: 0; }
  .hero { min-height: 190px; padding: 20px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { flex: 0 0 auto; padding: 0 14px; }
  .metrics, .daily-summary { border: 0; gap: 8px; }
  .metrics article, .daily-summary article { border: 1px solid var(--line); }
  .model-grid { border-right: 1px solid var(--line); }
  .model-card { border-bottom: 1px solid var(--line); }
  .material-block-grid { gap: 8px; border: 0; }
  .material-block { border: 1px solid var(--line); }
}

/* MOKU JOINERY — final light header */
.hero {
  min-height: 310px;
  display: grid;
  place-items: center;
  padding: 38px 42px;
  color: #1b1b1a;
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(34, 31, 27, .055) 50%, transparent 50.1%),
    linear-gradient(180deg, #f6f2eb 0%, #eee8df 100%);
  border: 1px solid #d9d2c8;
  border-radius: 0;
  box-shadow: none;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(34, 31, 27, .11);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 96px;
  height: 3px;
  transform: translateX(-50%);
  background: #242321;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.brand-intro {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 30px;
  text-align: center;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 24px;
  color: #171716;
}

.brand-name {
  margin-right: -.39em;
  font-size: clamp(3.4rem, 7vw, 6.7rem);
  font-weight: 300;
  letter-spacing: .39em;
  line-height: .82;
}

.brand-subtitle {
  display: grid;
  grid-template-columns: minmax(34px, 72px) auto minmax(34px, 72px);
  align-items: center;
  gap: 18px;
  font-size: clamp(.72rem, 1.35vw, 1.08rem);
  font-weight: 400;
  letter-spacing: .52em;
  line-height: 1;
}

.brand-subtitle::before,
.brand-subtitle::after {
  content: "";
  height: 1px;
  background: #aaa39a;
}

.hero h1 {
  max-width: none;
  margin: 0;
  color: #6d6963;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .23em;
  text-transform: uppercase;
}

.hero-actions {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  gap: 7px;
}

.hero .ghost-button,
.hero .danger-button {
  min-height: 36px;
  padding: 0 13px;
  color: #4c4945;
  background: rgba(246, 242, 235, .72);
  border: 1px solid #c8c1b8;
  font-size: .64rem;
  letter-spacing: .1em;
  backdrop-filter: blur(8px);
}

.hero .ghost-button:hover,
.hero .danger-button:hover {
  color: #f6f2eb;
  background: #262522;
  border-color: #262522;
}

@media (max-width: 760px) {
  .hero {
    min-height: 285px;
    padding: 76px 24px 34px;
  }

  .hero::before { inset: 9px; }

  .brand-intro { gap: 25px; }

  .brand-lockup { gap: 20px; }

  .brand-name {
    font-size: clamp(2.65rem, 15vw, 4.2rem);
    letter-spacing: .3em;
    margin-right: -.3em;
  }

  .brand-subtitle {
    grid-template-columns: 28px auto 28px;
    gap: 11px;
    font-size: .66rem;
    letter-spacing: .37em;
  }

  .hero-actions {
    top: 20px;
    right: 20px;
  }

  .hero .ghost-button,
  .hero .danger-button {
    min-height: 32px;
    padding: 0 9px;
    font-size: .58rem;
  }
}

/* Quiet sign-out control inside the MOKU header */
.hero-actions {
  top: 25px;
  right: 30px;
}

.hero #logout {
  min-height: 32px;
  padding: 0 2px 6px;
  color: #69645d;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #aaa299;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .18em;
}

.hero #logout:hover {
  color: #171716;
  background: transparent;
  border-color: #171716;
}

@media (max-width: 760px) {
  .hero-actions {
    top: 18px;
    right: 19px;
  }
}

/* Compact minimal MOKU header */
.hero {
  min-height: 190px;
  padding: 30px 72px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #d8d2c9;
}

.hero::before,
.hero::after {
  display: none;
}

.brand-intro {
  width: auto;
  display: grid;
  place-items: center;
  gap: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.brand-lockup {
  display: grid;
  place-items: center;
  gap: 17px;
}

.brand-name {
  margin-right: -.34em;
  font-size: clamp(2.9rem, 5.2vw, 4.8rem);
  font-weight: 300;
  letter-spacing: .34em;
  line-height: .82;
}

.brand-subtitle {
  grid-template-columns: 48px auto 48px;
  gap: 14px;
  font-size: clamp(.62rem, .9vw, .78rem);
  font-weight: 400;
  letter-spacing: .48em;
}

.brand-subtitle::before,
.brand-subtitle::after {
  background: #b7b0a7;
}

.hero-actions {
  top: 22px;
  right: 25px;
}

.hero #logout {
  min-height: 28px;
  padding-bottom: 4px;
  color: #777169;
  border-color: #c0b9b0;
  font-size: .58rem;
}

@media (max-width: 760px) {
  .hero {
    min-height: 172px;
    padding: 44px 48px 28px;
  }

  .brand-lockup { gap: 15px; }

  .brand-name {
    font-size: clamp(2.35rem, 13vw, 3.25rem);
    letter-spacing: .28em;
    margin-right: -.28em;
  }

  .brand-subtitle {
    grid-template-columns: 30px auto 30px;
    gap: 10px;
    font-size: .57rem;
    letter-spacing: .37em;
  }

  .hero-actions {
    top: 13px;
    right: 15px;
  }
}

/* Centered section navigation — final */
.tabs {
  width: 100%;
  min-height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 0 0 18px;
  padding: 8px 14px;
  background: #ecebe8;
  border: 1px solid #d8d6d1;
}

.tab {
  min-height: 42px;
  padding: 0 17px;
  color: #64615d;
  background: transparent;
  border: 1px solid transparent;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
}

.tab:hover {
  color: #191919;
  background: rgba(255, 255, 255, .7);
  border-color: #d2d0cb;
}

.tab.is-active {
  color: #fff;
  background: #323232;
  border-color: #323232;
}

@media (max-width: 760px) {
  .tabs {
    min-height: 58px;
    justify-content: flex-start;
    padding: 7px 9px;
    overflow-x: auto;
  }

  .tab {
    min-height: 40px;
    padding: 0 13px;
    font-size: .63rem;
  }
}

/* Minimal work-time entry */
.time-entry-grid {
  display: grid;
  grid-template-columns: 170px minmax(220px, .8fr) minmax(300px, 1.4fr);
  gap: 12px;
  align-items: end;
}

.work-clock-grid {
  display: grid;
  grid-template-columns: 170px 170px minmax(190px, 1fr);
  gap: 12px;
  align-items: end;
}

.date-field input[type="date"] {
  color: #383838;
  background: #fafafa;
}

#daily-start,
#daily-end {
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

#daily-hours[readonly] {
  color: #fff;
  background: #343434;
  border-color: #343434;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: default;
}

#daily-view > .panel:first-child {
  padding: 24px;
}

@media (max-width: 900px) {
  .time-entry-grid,
  .work-clock-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact two-column order workspace */
.orders-board {
  padding: 20px;
  background: #f1f0ed;
}

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

.order-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8d6d1;
}

.oak-usage-form {
  display: grid;
}

.board-card-head {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  background: #343434;
}

.board-card-head h3 {
  margin: 0;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: .02em;
}

.board-card-head strong {
  font-size: .84rem;
  font-weight: 600;
}

.oak-price-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #dfddd8;
}

.oak-price-row > span {
  padding-bottom: 10px;
  color: #4f4c48;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.oak-price-row label {
  width: 150px;
}

.oak-price-row input {
  min-height: 34px;
}

.oak-parts-grid {
  display: grid;
  gap: 0;
}

.oak-part {
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid #dfddd8;
}

.oak-part-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.oak-part-title strong {
  font-size: .82rem;
}

.oak-part-title span {
  color: #68645f;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.oak-dimensions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.oak-dimensions label {
  font-size: .57rem;
  letter-spacing: .04em;
}

.oak-dimensions input {
  min-width: 0;
  min-height: 34px;
  padding: 6px 7px;
  font-size: .76rem;
}

.oak-card-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
}

.oak-save-status {
  color: #77736d;
  font-size: .68rem;
}

.oak-card-footer .ghost-button {
  min-height: 34px;
  padding: 0 12px;
}

.order-create-panel {
  width: min(100%, 760px);
}

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

@media (max-width: 560px) {
  .orders-board { padding: 10px; }
  .oak-dimensions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oak-price-row { align-items: stretch; flex-direction: column; }
  .oak-price-row label { width: 100%; }
}

.plywood-usage {
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  background: #f5f4f1;
  border-bottom: 1px solid #dfddd8;
}

.plywood-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.plywood-fields input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: .76rem;
}

.oak-price-row input[readonly],
.plywood-fields input[readonly] {
  color: #55514c;
  background: #eceae6;
  border-color: #d5d2cc;
}

.oak-group,
.finish-usage {
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid #dfddd8;
}

.oak-piece-list,
.finish-layers {
  display: grid;
  gap: 7px;
}

.oak-piece {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 6px;
  padding: 8px;
  background: #f6f5f2;
  border: 1px solid #e0ded9;
}

.remove-piece,
.finish-layer button {
  min-height: 32px;
  padding: 0 7px;
  color: #77716a;
  background: transparent;
  border: 0;
  font-size: .6rem;
  text-transform: uppercase;
}

.add-piece,
.finish-usage > .ghost-button {
  min-height: 32px;
  justify-self: start;
  padding: 0 10px;
  font-size: .6rem;
}

.finish-usage {
  background: #fff;
}

.epoxy-usage {
  background: #f5f4f1;
}

.finish-layer {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 1px solid #dfddd8;
}

.finish-layer span {
  padding-bottom: 9px;
  color: #5c5853;
  font-size: .72rem;
}

@media (max-width: 560px) {
  .oak-piece { grid-template-columns: 1fr; }
  .finish-layer { grid-template-columns: 1fr auto; }
  .finish-layer label { grid-column: 1 / -1; }
}

/* Wide order card with rough and finishing columns */
.order-list {
  grid-template-columns: 1fr;
}

.materials-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: stretch;
}

.material-column {
  min-width: 0;
  background: #fff;
}

.material-column + .material-column {
  border-left: 1px solid #d8d6d1;
}

.material-column > h4 {
  margin: 0;
  padding: 13px 14px;
  color: #55514c;
  background: #ecebe8;
  border-bottom: 1px solid #d8d6d1;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.finish-column {
  background: #f8f7f4;
}

.finish-column .finish-usage {
  background: transparent;
}

@media (max-width: 900px) {
  .materials-columns { grid-template-columns: 1fr; }
  .material-column + .material-column { border-left: 0; border-top: 1px solid #d8d6d1; }
}

.rough-column .plywood-fields {
  grid-template-columns: 1fr 1fr 1fr;
}

.fixed-usage-block {
  display: grid;
  gap: 0;
  padding: 12px 14px;
  background: #f8f7f4;
}

.fixed-usage-block > .oak-part-title {
  margin-bottom: 7px;
}

.fixed-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid #dedbd5;
}

.fixed-usage-row span {
  display: grid;
  gap: 2px;
  color: #393735;
  font-size: .72rem;
}

.fixed-usage-row small {
  color: #77716a;
  font-size: .62rem;
}

.fixed-usage-row strong {
  font-size: .75rem;
}

@media (max-width: 560px) {
  .rough-column .plywood-fields { grid-template-columns: 1fr; }
}
