﻿@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #f3f1ea;
  --panel: #ffffff;
  --text: #1c1b1f;
  --muted: #5b5b68;
  --accent: #1f4eff;
  --accent-dark: #1637b6;
  --stroke: #e4e0d7;
  --shadow: 0 20px 45px rgba(33, 33, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #e8f0ff, transparent 55%),
    radial-gradient(circle at 20% 70%, #f7e7d8, transparent 55%),
    var(--bg);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand__title {
  font-size: 22px;
  font-weight: 700;
}

.brand__subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.logout button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.logout button:hover {
  background: var(--accent-dark);
}

.content {
  padding: 0 40px 60px;
  flex: 1;
}

.panel,
.card {
  background: var(--panel);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.panel__section {
  margin-top: 24px;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
}

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

.alert {
  background: #ffe7e0;
  border: 1px solid #f7b6a2;
  padding: 12px 16px;
  border-radius: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat {
  background: #f5f6fb;
  border-radius: 16px;
  padding: 16px;
}

.stat__label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat__value {
  font-size: 28px;
  font-weight: 700;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form.compact {
  flex-direction: row;
  align-items: center;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input,
select,
button,
textarea {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  font-size: 14px;
}

button {
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

button.primary:hover {
  background: var(--accent-dark);
}

button.ghost {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
}

.link {
  color: var(--accent);
  text-decoration: none;
}

.sort-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.sort-link:hover {
  color: var(--accent);
}

.b2b-row td {
  background: #fff4d6;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.tag--b2b {
  background: #1f4eff;
  color: #fff;
}

.tag--warn {
  background: #f5a623;
  color: #1c1b1f;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

th,
td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--stroke);
}

.pill {
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-block;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.checkbox-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 24px;
}

.order-layout__col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.login-card {
  max-width: 420px;
  margin: 60px auto 0;
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 16px;
  overflow-x: auto;
  font-size: 12px;
}

.bom-row td {
  background: #f9f8f4;
}

.bom {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--stroke);
}

.bom__header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.bom__tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bom-table th,
.bom-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--stroke);
}

.production-task + .production-task {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.production-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.board__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.board__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2f3130;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
}

.check input {
  accent-color: var(--accent);
}

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

.board-card {
  background: #2f3130;
  color: #fff;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #3d3f3e;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.board-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  border-bottom: 1px solid #4a4d4c;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.board-card__title {
  font-size: 18px;
  letter-spacing: 0.04em;
}

.board-card__meta {
  font-size: 12px;
  text-transform: uppercase;
  color: #d5d7d6;
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-card__steps {
  display: grid;
  grid-template-columns: repeat(var(--stage-count, 3), minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.step {
  display: flex;
  align-items: center;
  gap: 4px;
}

.step__node {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.step__node--done {
  background: #129e3e;
  border-color: #129e3e;
}

.step__node--current {
  background: #8bc695;
  border-color: #8bc695;
  color: #fff;
}

.step__node--todo {
  background: #fff;
  border-color: #fff;
  color: transparent;
}

.step__line {
  flex: 1;
  height: 2px;
  background: #fff;
}

.step__line--done,
.step__line--current {
  background: #fff;
}

.board-card__labels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.step__label {
  text-align: center;
  line-height: 1.2;
  padding: 0 4px;
  word-break: break-word;
}

.step__label--single {
  justify-self: center;
  background: #2a2c2b;
  border-radius: 999px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.board-card__actions {
  margin-top: 12px;
  border-top: 1px solid #4a4d4c;
  padding-top: 10px;
}

.board-card__actions summary {
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d5d7d6;
  margin-bottom: 8px;
}

.board-card__actions summary::marker {
  color: #d5d7d6;
}

.board-card__actions .form.compact {
  gap: 8px;
}

.board-card__actions select {
  background: #2a2c2b;
  color: #fff;
  border: 1px solid #4a4d4c;
}

.board-card--alert {
  border-color: #f5a623;
  box-shadow: 0 8px 18px rgba(245, 166, 35, 0.2);
}

.line-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.missing-row td {
  background: #fff4d6;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-list li {
  padding: 12px;
  border-radius: 12px;
  background: #f5f6fb;
}

.comment__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.comment__text {
  white-space: pre-wrap;
}

.summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.summary::marker {
  color: var(--muted);
}

.inline-form {
  display: inline-flex;
  margin-left: 8px;
}

button.small {
  padding: 4px 10px;
  font-size: 12px;
}

@media (max-width: 768px) {
  .topbar {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .content {
    padding: 0 20px 40px;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

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