/* Тема: авторазборка. Индустриальный гараж - бетон, сталь, янтарь,
   предупредительная разметка и технические моноширинные цифры,
   как номера деталей на складе. */

:root {
  --ground: #E9E6E1;
  --ground-2: #DFDBD4;
  --surface: #FFFFFF;
  --surface-2: #F4F2EE;
  --ink: #1A1D21;
  --muted: #5A5F66;
  --faint: #8A8F97;
  --border: #CFCBC3;
  --border-strong: #B4AFA5;

  --accent: #B45309;
  --accent-ink: #FFFFFF;
  --accent-soft: #FBEFE0;

  --steel: #3E5C70;
  --steel-soft: #E2EAEF;

  --good: #2C7A52;
  --good-soft: #DFF0E6;
  --warn: #A66D08;
  --warn-soft: #FAEFD8;
  --bad: #A93B28;
  --bad-soft: #F8E3DE;

  --shadow: 0 1px 2px rgba(26, 29, 33, .07), 0 10px 26px rgba(26, 29, 33, .09);
  --hazard: repeating-linear-gradient(
    135deg,
    var(--accent) 0 10px,
    transparent 10px 20px
  );
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #16181B;
    --ground-2: #101214;
    --surface: #1F2227;
    --surface-2: #272B31;
    --ink: #ECE8E1;
    --muted: #A5AAB2;
    --faint: #757A82;
    --border: #343941;
    --border-strong: #454B54;

    --accent: #F59E0B;
    --accent-ink: #1A1206;
    --accent-soft: #392A11;

    --steel: #8FB3C9;
    --steel-soft: #24333D;

    --good: #64C08E;
    --good-soft: #16301F;
    --warn: #E0A62F;
    --warn-soft: #362A11;
    --bad: #E08573;
    --bad-soft: #38211C;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 30px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ---------- шапка ---------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  position: relative;
}

/* предупредительная лента под шапкой - подпись гаража */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
  background: var(--hazard);
  opacity: .85;
}

.topbar .brand {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-transform: uppercase;
}

.topbar .brand .bolt {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.topbar nav { display: flex; gap: 1.1rem; margin-left: auto; align-items: center; }

.topbar nav a {
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
}

.topbar nav a:hover { color: var(--accent); }
.topbar .who { color: var(--faint); font-size: .82rem; font-family: ui-monospace, Consolas, monospace; }

/* ---------- каркас ---------- */

.wrap { max-width: 64rem; margin: 0 auto; padding: 2.25rem 1.5rem 4rem; }
.wrap--narrow { max-width: 30rem; padding-top: 4rem; }

h1 {
  font-size: 1.55rem;
  margin: 0 0 .3rem;
  letter-spacing: -.015em;
  font-weight: 800;
}

h2 {
  font-size: .82rem;
  margin: 2.5rem 0 .9rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--faint);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .75rem;
}

h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.lede { color: var(--muted); margin: 0 0 1.75rem; font-size: .94rem; }

.crumb {
  font-size: .78rem;
  color: var(--faint);
  margin-bottom: .6rem;
  font-family: ui-monospace, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--accent); }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- карточки ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.card--accent { border-left: 3px solid var(--accent); }

.scroll { overflow-x: auto; }

/* ---------- таблицы ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .89rem;
  min-width: 40rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

th {
  text-align: left;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  padding: .75rem .9rem;
  border-bottom: 2px solid var(--border-strong);
  background: var(--surface-2);
  white-space: nowrap;
  font-weight: 800;
}

td { padding: .75rem .9rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

td .sub { display: block; font-size: .76rem; color: var(--muted); margin-top: .1rem; }
td a { text-decoration: none; font-weight: 700; color: var(--ink); }
td a:hover { color: var(--accent); }

/* ---------- статусы ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .22rem .6rem;
  border-radius: 3px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.chip::before {
  content: "";
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: currentColor;
}

.chip--good { background: var(--good-soft); color: var(--good); }
.chip--warn { background: var(--warn-soft); color: var(--warn); }
.chip--bad { background: var(--bad-soft); color: var(--bad); }
.chip--idle { background: var(--surface-2); color: var(--faint); border: 1px solid var(--border); }

/* ---------- формы ---------- */

label {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: .62rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .92rem;
}

textarea { resize: vertical; min-height: 4.75rem; line-height: 1.5; }

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.field { margin-bottom: 1.15rem; }
.hint { font-size: .8rem; color: var(--faint); margin-top: .35rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .62rem 1.15rem;
  border-radius: 3px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.btn:hover { filter: brightness(1.08); }

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn--ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }

.btn--danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: var(--surface); filter: none; }

.btn--wide { width: 100%; }

.btn-row, .actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.actions { margin: 1.75rem 0 1.25rem; }
.actions form { margin: 0; }

/* ---------- сообщения ---------- */

.note {
  border-left: 3px solid var(--steel);
  background: var(--steel-soft);
  border-radius: 0 3px 3px 0;
  padding: .85rem 1.05rem;
  margin-bottom: 1.25rem;
  font-size: .89rem;
}

.note--bad { border-left-color: var(--bad); background: var(--bad-soft); }
.note--warn { border-left-color: var(--warn); background: var(--warn-soft); }

/* ---------- показатели ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow);
}

.stat { background: var(--surface); padding: .95rem 1.05rem; }

.stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: -.02em;
}

.stat span {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  font-weight: 700;
}

.bar {
  height: .6rem;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, .22) 0 6px,
    transparent 6px 12px
  );
}

/* ---------- варианты текста ---------- */

.variant {
  border: 1px solid var(--border);
  border-left: 3px solid var(--steel);
  border-radius: 0 3px 3px 0;
  padding: .7rem .9rem;
  font-size: .88rem;
  margin-bottom: .55rem;
  background: var(--surface);
}

.variant .n {
  color: var(--accent);
  font-size: .7rem;
  margin-right: .5rem;
  font-weight: 800;
  font-family: ui-monospace, Consolas, monospace;
}

/* ---------- правила отбора ---------- */

.rules {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: .5rem 1rem;
  margin: 0;
  font-size: .88rem;
}

.rules dt {
  color: var(--faint);
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .06em;
  font-weight: 800;
  padding-top: .15rem;
}

.rules dd { margin: 0; }

.empty { color: var(--faint); font-size: .9rem; padding: 2rem 0; text-align: center; }

/* ---------- вход ---------- */

.login-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
}

.hazard-strip {
  height: 5px;
  background: var(--hazard);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  opacity: .9;
}

@media (max-width: 34rem) {
  .rules { grid-template-columns: 1fr; gap: .1rem; }
  .rules dd { margin-bottom: .7rem; }
  .page-head { flex-direction: column; gap: .6rem; }
}
