/* Доска клиента. Mobile-first: сначала телефон, потом всё остальное.
   Палитра — та же, что у панели и HQ. Внешних шрифтов и CDN нет. */

:root {
  --bg: #0b0f14;
  --surface: #11161d;
  --surface-2: #161d26;
  --surface-3: #1c2530;
  --line: #222c38;
  --line-strong: #32404f;

  --text: #e7edf4;
  --text-2: #93a1b1;
  --text-3: #6b7888;

  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.13);

  --green: #46b95b;
  --yellow: #d8a029;
  --orange: #ef8a3c;
  --red: #f4645c;
  --grey: #7d8794;

  --tint-green: rgba(70, 185, 91, 0.13);
  --tint-yellow: rgba(216, 160, 41, 0.14);
  --tint-orange: rgba(239, 138, 60, 0.14);
  --tint-blue: rgba(88, 166, 255, 0.13);
  --tint-grey: rgba(125, 135, 148, 0.14);

  --r: 10px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + var(--safe-bottom));
}

.top {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(var(--surface), rgba(11, 15, 20, .96));
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  backdrop-filter: blur(8px);
}
.top__client { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.top__who { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.top { position: relative; }
.top #logout {
  position: absolute; top: 50%; right: 16px; transform: translateY(-20%);
  min-height: 36px; padding: 8px 12px; font-size: 13px;
}

.page { padding: 16px; max-width: 760px; margin: 0 auto; }

/* ── группы состояний ─────────────────────────────────────────────── */

.group { margin-bottom: 26px; }
.group__head {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px;
}
.group__title { font-size: 13px; font-weight: 650; letter-spacing: .02em; }
.group__count { font: 600 11px var(--mono); color: var(--text-3); }
.group--act .group__title { color: var(--orange); }

/* ── карточка ─────────────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin-bottom: 10px;
}
.card--act { border-color: rgba(239, 138, 60, .38); }
.card__title { font-size: 15.5px; font-weight: 560; line-height: 1.4; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }

.chip {
  font: 600 11px/1 var(--mono); padding: 5px 8px; border-radius: 999px;
  background: var(--tint-grey); color: var(--grey); white-space: nowrap;
}
.chip--review { background: var(--tint-orange); color: var(--orange); }
.chip--data   { background: var(--tint-yellow); color: var(--yellow); }
.chip--work   { background: var(--tint-blue); color: var(--accent); }
.chip--done   { background: var(--tint-green); color: var(--green); }
.chip--owner  { background: var(--surface-3); color: var(--text-2); }

.card__comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment { font-size: 13.5px; margin-bottom: 8px; }
.comment__who { font-weight: 600; font-size: 12.5px; }
.comment__who--us { color: var(--accent); }
.comment__body { color: var(--text-2); }
.comment__at { font: 11px var(--mono); color: var(--text-3); margin-left: 6px; }

.card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ── элементы управления: крупные, под палец ──────────────────────── */

button, .btn {
  font: 500 14px var(--sans); color: var(--text);
  background: var(--surface-3); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 11px 14px; cursor: pointer;
  min-height: 44px;                 /* минимальная цель для касания */
}
button:active { background: var(--surface-2); }
button.primary { background: var(--accent-soft); border-color: rgba(88,166,255,.45); color: var(--accent); }
button.small { min-height: 38px; padding: 8px 12px; font-size: 13px; }
button:disabled { opacity: .5; }

textarea, input[type=text], select {
  width: 100%; font: 15px/1.5 var(--sans); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 12px; min-height: 46px;
}
textarea { resize: vertical; }

/* ── нижняя панель действия ───────────────────────────────────────── */

.fab {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(rgba(11,15,20,0), var(--bg) 38%);
}
.fab button { width: 100%; max-width: 728px; margin: 0 auto; display: block; font-size: 15px; }

/* ── лист создания ────────────────────────────────────────────────── */

.sheet {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: rgba(3, 6, 10, .72); align-items: flex-end;
}
.sheet[data-open="1"] { display: flex; }
.sheet__panel {
  background: var(--surface); border-top: 1px solid var(--line-strong);
  border-radius: 14px 14px 0 0; padding: 18px 16px calc(18px + var(--safe-bottom));
  width: 100%; max-height: 88vh; overflow: auto;
}
.sheet__title { font-size: 17px; font-weight: 650; margin: 0 0 14px; }
.sheet__row { display: flex; gap: 8px; margin-top: 12px; }
.sheet__row button { flex: 1; }

.kinds { display: flex; gap: 8px; margin-bottom: 12px; }
.kinds button { flex: 1; }
.kinds button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.empty {
  color: var(--text-3); font-size: 14px; padding: 22px 16px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r);
}
.note { color: var(--text-3); font-size: 12.5px; margin-top: 14px; }
.error {
  background: rgba(244,100,92,.14); border: 1px solid rgba(244,100,92,.32);
  color: var(--red); border-radius: 8px; padding: 12px; font-size: 14px; margin-bottom: 14px;
}
.ok {
  background: var(--tint-green); border: 1px solid rgba(70,185,91,.3);
  color: var(--green); border-radius: 8px; padding: 12px; font-size: 14px; margin-bottom: 14px;
}

@media (min-width: 720px) {
  .sheet { align-items: center; justify-content: center; }
  .sheet__panel { border-radius: 14px; max-width: 560px; border: 1px solid var(--line-strong); }
  .fab { position: static; background: none; padding: 0 0 24px; }
}

/* ── вход ─────────────────────────────────────────────────────────── */

[hidden] { display: none !important; }

.login {
  min-height: 78vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.login__card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 22px calc(26px + var(--safe-bottom));
}
.login__title { font-size: 20px; letter-spacing: -.015em; margin: 0 0 8px; }
.login__hint { font-size: 14px; color: var(--text-3); margin: 0 0 20px; line-height: 1.5; }
.login__card input { margin-bottom: 14px; }
.login__card button { width: 100%; }
.login__error {
  background: rgba(244,100,92,.14); border: 1px solid rgba(244,100,92,.32);
  color: var(--red); border-radius: 8px; padding: 11px 13px;
  font-size: 14px; margin-bottom: 14px;
}
