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

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #f8fafc;
  --dim: #94a3b8;
  --accent: #38bdf8;
  --accent-ink: #04293a;
  --error: #fca5a5;
  --tap: 60px;            /* меньше этого палец не попадает */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.screen[hidden], [hidden] { display: none !important; }

/* ── Вход ─────────────────────────────────────────────────────────────── */

.screen--login { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login { width: 100%; max-width: 380px; text-align: center; }
.login__logo { font-size: 56px; line-height: 1; }
.login__title { margin: 12px 0 4px; font-size: 26px; font-weight: 700; }
.login__hint { margin: 0 0 24px; color: var(--dim); }
.login__foot { margin-top: 24px; color: var(--dim); font-size: 14px; }

.code {
  width: 100%;
  padding: 18px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 10px;
  text-align: center;
}
.code:focus { outline: none; border-color: var(--accent); }
.code::placeholder { letter-spacing: 6px; color: #475569; font-weight: 400; }

.error { margin: 12px 0 0; color: var(--error); font-weight: 600; }

.btn {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}
.btn:disabled { opacity: .55; }
.btn--big { min-height: 64px; }
.btn--ghost {
  width: auto;
  margin: 0;
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 15px;
  font-weight: 600;
}

/* ── Оболочка ─────────────────────────────────────────────────────────── */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.top__name { font-size: 19px; font-weight: 700; }
.top__role { color: var(--dim); font-size: 14px; }

.main { padding: 16px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  display: grid; gap: 6px; align-content: start;
  min-height: 116px; padding: 16px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); color: var(--text);
  text-align: left; font: inherit; cursor: pointer;
}
.tile__icon { font-size: 28px; }
.tile__name { font-weight: 700; font-size: 17px; }
.tile__soon { color: var(--dim); font-size: 13px; }
.tile[data-soon] { opacity: .65; }

.note { margin: 20px 2px; color: var(--dim); font-size: 14px; }

.boot { display: grid; place-items: center; min-height: 100dvh; color: var(--dim); }
.boot[hidden] { display: none; }

/* Светлая тема — на случай яркого дня в цеху и телефонов с ней по умолчанию. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc; --card: #fff; --line: #cbd5e1;
    --text: #0f172a; --dim: #64748b; --accent: #0284c7; --accent-ink: #fff; --error: #b91c1c;
  }
}

/* ── Экраны приёмки ───────────────────────────────────────────────────── */

.top__who { flex: 1; min-width: 0; }
.back {
  width: 44px; height: 44px; margin-right: 4px;
  border: 1px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--text);
  font-size: 26px; line-height: 1; cursor: pointer;
}

.h1 { margin: 4px 0 12px; font-size: 22px; }
.h2 { margin: 24px 0 10px; font-size: 17px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.dim { color: var(--dim); margin: 8px 0; }
.pad { height: 40px; }

.input {
  width: 100%; min-height: 54px; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--text); font: inherit;
}
.input:focus { outline: none; border-color: var(--accent); }
.input--plate { font-size: 22px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.input--area { min-height: 88px; resize: vertical; }
.label { display: block; margin: 18px 0 6px; font-weight: 600; }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.row { display: flex; gap: 8px; align-items: stretch; }
.row .input { flex: 1; }
.btn--side { width: auto; margin: 0; padding: 0 18px; }
.btn--wide { width: 100%; margin-top: 12px; text-align: center; line-height: 44px; }

/* Список: машины, приёмки */
.list { display: grid; gap: 8px; margin-top: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--text); text-align: left; font: inherit;
}
.item--tap { cursor: pointer; min-height: var(--tap); }
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: 700; font-size: 17px; }
.item__sub { color: var(--dim); font-size: 14px; margin-top: 2px; }
.item__go { color: var(--dim); font-size: 26px; }

/* Карточка машины в форме */
.card { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.card--car { margin-bottom: 8px; }
.card__plate { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.card__model { color: var(--dim); margin-top: 2px; }
.card__last { color: var(--dim); font-size: 14px; margin-top: 8px; }

.warn {
  margin: 12px 0; padding: 12px 14px; border-radius: 12px;
  background: rgba(250, 204, 21, .12); border: 1px solid rgba(250, 204, 21, .45);
  color: #fde68a; font-size: 14px; line-height: 1.4;
}
.warn--inline { margin: 8px 0 0; }

/* Выбранные работы */
.picked { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 14px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 15px;
}
.chip__x {
  border: 0; background: rgba(0,0,0,.18); color: inherit;
  width: 26px; height: 26px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer;
}

/* Прайс по категориям */
.cats { display: grid; gap: 8px; }
.cat { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.cat__name { padding: 16px; font-weight: 700; cursor: pointer; list-style: none; }
.cat__name::-webkit-details-marker { display: none; }
.cat__name::after { content: '＋'; float: right; color: var(--dim); }
.cat[open] .cat__name::after { content: '−'; }
.cat__works { display: grid; }
.work {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  min-height: 54px; padding: 12px 16px;
  border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.work__price { color: var(--dim); white-space: nowrap; }

/* Фото */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--card); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo__x {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; cursor: pointer;
}

/* Готово */
.done { text-align: center; padding: 32px 8px; }
.done__mark {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 46px; line-height: 84px; font-weight: 700;
}
.tile--go { opacity: 1; }

/* ── Отчёт по работе ──────────────────────────────────────────────────── */

.day {
  margin: 16px 0 0; padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--dim);
}
.day b { color: var(--text); }

/* Пункт плана: галочка во всю ширину — пальцем в чекбокс никто не попадает */
.check {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  cursor: pointer;
}
.check input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.check__name { flex: 1; font-weight: 600; }
.check__price { color: var(--dim); white-space: nowrap; }

.item--row { gap: 8px; }
.sum {
  width: 92px; min-height: 44px; padding: 8px 10px; text-align: right;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-weight: 600;
}
.tagp {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--line); color: var(--dim); font-size: 12px; font-weight: 600;
}

.row--add { margin-top: 8px; }
.input--sum { width: 104px; flex: none; text-align: right; }
.btn--half { width: 50%; margin-top: 8px; }

.total {
  margin: 20px 0 4px; padding: 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--accent);
  font-size: 20px; font-weight: 700; text-align: center;
}

/* ── Мои работы ───────────────────────────────────────────────────────── */

.seg { display: flex; gap: 6px; padding: 4px; margin: 12px 0 16px;
       border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.seg__b {
  flex: 1; min-height: 46px; border: 0; border-radius: 10px;
  background: transparent; color: var(--dim); font: inherit; font-weight: 600; cursor: pointer;
}
.seg__b--on { background: var(--accent); color: var(--accent-ink); }

.sumcard {
  padding: 16px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card);
}
.sumcard__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; color: var(--dim); }
.sumcard__row b { color: var(--text); font-size: 17px; }
.sumcard__row--big { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sumcard__row--big b { color: var(--accent); font-size: 22px; }

.item__sum { font-weight: 700; white-space: nowrap; }

/* ── Должность и осмотр ───────────────────────────────────────────────── */

.top__who { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit;
            font: inherit; text-align: left; padding: 0; cursor: pointer; }
.work--on { background: rgba(56, 189, 248, .12); font-weight: 700; }

/* Четыре стороны: крупные плитки, снятая — с превью и галочкой */
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side {
  position: relative; display: grid; place-items: center; gap: 6px;
  aspect-ratio: 4 / 3; padding: 10px;
  border: 2px dashed var(--line); border-radius: 16px; background: var(--card);
  cursor: pointer; overflow: hidden;
}
.side img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.side__cam { font-size: 30px; }
.side__name {
  position: relative; z-index: 1; padding: 4px 10px; border-radius: 999px;
  background: rgba(15, 23, 42, .72); color: #f8fafc; font-size: 14px; font-weight: 600;
}
.side--done { border-style: solid; border-color: var(--accent); }
.side--busy { opacity: .5; }

/* Мелкие кнопки в списках администратора */
.btn--mini {
  width: auto; margin: 0; min-height: 40px; padding: 0 12px;
  font-size: 14px; white-space: nowrap;
}

/* Заявка на доступ — то, что ждёт решения */
.item--warn { border-color: rgba(250, 204, 21, .5); background: rgba(250, 204, 21, .08); }
#adm-tabs { flex-wrap: wrap; }
#adm-tabs .seg__b { flex: 1 1 30%; font-size: 15px; }

/* Подпись водителя */
.sign {
  width: 100%; height: auto; aspect-ratio: 600 / 220;
  border: 2px solid var(--line); border-radius: 14px; background: #fff;
  touch-action: none;   /* иначе палец листает страницу вместо росчерка */
}

/* Дашборд владельца */
#dash { display: grid; gap: 12px; margin-bottom: 8px; }
.dash__card {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--text);
  padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  cursor: pointer;
}
.dash__card[disabled] { cursor: default; }
.dash__title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-weight: 700; font-size: 17px;
}
.dash__go { color: var(--dim); font-size: 24px; line-height: 1; }
