/* Цех 59 — приложение сотрудников. Крупные кнопки под палец (≥48 px).
   Цвета — фирменные AviraKids (логотип на plasticshariki.ru): бирюзовый #17AEC1 и малиновый #E51A4B.
   Для текста и кнопок — более глубокие оттенки тех же цветов, чтобы читалось (контраст ≥ 4,5). */
:root {
  --bg: #F2F6F7;
  --card: #FFFFFF;
  --ink: #17201C;
  --muted: #4F5B55;
  --line: #E0E8EA;
  --field: #C6D5D8;
  --brand: #17AEC1;        /* фирменный бирюзовый — полоски, выбор, значок */
  --brand2: #E51A4B;       /* фирменный малиновый */
  --brand2-ink: #C8153F;   /* малиновый для текста и карточек с белым текстом */
  --accent: #0B7F8C;       /* кнопки (белый текст: контраст 4,7) */
  --accent-text: #0A7380;  /* бирюзовый текст на светлом фоне (5,1) */
  --accent-ink: #075F69;
  --accent-soft: #DDF3F6;
  --accent-line: #8FD5DE;
  --warn: #8A4B00;
  --warn-soft: #FBF0DE;
  --bad: #C8153F;
  --bad-soft: #FDE4EA;
  --shadow: 0 1px 2px rgba(23, 32, 28, 0.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { border-top: 4px solid var(--brand); }
body {
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 520px; margin: 0 auto; min-height: 100vh;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 16px;
}
.screen.center { align-items: center; justify-content: center; text-align: center; gap: 12px; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; text-wrap: balance; }
h2 { margin: 0; font-size: 17px; font-weight: 650; }
p { margin: 0; }
.loading { color: var(--muted); text-align: center; margin-top: 40vh; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand2-ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px;
        display: flex; flex-direction: column; gap: 10px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.pill.on { background: var(--accent-soft); color: var(--accent-ink); }
.pill.off { background: #E7EBE9; color: var(--muted); }
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 600; }

/* кнопки */
button, .btn {
  font: inherit; cursor: pointer; border-radius: 14px; min-height: 52px; padding: 0 18px;
  border: 1.5px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; font-weight: 600; font-size: 17px;
}
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent-line); outline-offset: 2px;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.btn.ghost { background: transparent; color: var(--accent-text); border-color: var(--accent-line); }
.btn.dashed { background: transparent; color: var(--accent-text); border: 1.5px dashed var(--brand); }
.btn.danger { background: transparent; color: var(--bad); border-color: #F0B3C2; }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 12px; border-radius: 10px; }
.btn.block { width: 100%; }
.menu-btn { justify-content: flex-start; min-height: 68px; text-align: left; padding: 12px 18px; }
.menu-btn .t { display: block; font-size: 19px; }
.menu-btn .s { display: block; font-size: 13px; font-weight: 400; opacity: .85; }
.menu-btn.secondary .s { color: var(--muted); opacity: 1; }
.back { background: none; border: none; color: var(--accent-text); min-height: 44px; padding: 0; justify-content: flex-start;
        font-size: 15px; font-weight: 500; }

/* выбор (чипы и сегменты) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--field); background: var(--card);
        color: var(--ink); font-weight: 500; font-size: 16px; }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.seg { display: flex; gap: 6px; background: #E3E8E5; padding: 4px; border-radius: 14px; }
.seg button { flex: 1; min-height: 46px; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(23,32,28,.12); }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); flex: none; display: inline-block; }

/* поля */
label.lbl { font-size: 15px; font-weight: 600; }
input, select, textarea {
  font: inherit; width: 100%; min-height: 52px; border-radius: 12px; border: 1.5px solid var(--field);
  background: var(--card); color: var(--ink); padding: 0 14px; font-size: 18px;
}
textarea { min-height: 96px; padding: 12px 14px; font-size: 16px; resize: vertical; }
input.big { min-height: 64px; font-size: 28px; font-weight: 700; }
.hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--accent-soft);
        border-radius: 12px; padding: 8px 10px 8px 14px; font-size: 14px; color: var(--accent-ink); }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.error { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-size: 15px; }

/* списки */
.list { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 2px 14px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: none; }
.li .grow { flex: 1; min-width: 0; }
.li .sub { font-size: 13px; color: var(--muted); }
.li .num { font-weight: 700; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { min-height: 44px; width: 44px; padding: 0; border-radius: 10px; background: #E7EBE9; color: var(--ink); font-size: 22px; }
.stepper .n { min-width: 36px; text-align: center; font-weight: 700; font-size: 18px; }

.total { display: flex; justify-content: space-between; align-items: center; background: var(--accent-soft);
         border-radius: 14px; padding: 14px 16px; color: var(--accent-ink); }
.total .v { font-size: 24px; font-weight: 700; }
.hero { background: var(--brand2-ink); color: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.hero .v { font-size: 36px; font-weight: 700; line-height: 1.1; }
.summary { white-space: pre-line; font-size: 15px; line-height: 1.5; }
.footer { margin-top: auto; text-align: center; font-size: 12px; color: var(--muted); }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(24px, env(safe-area-inset-bottom));
         background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px;
         max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 10; }
@media (prefers-reduced-motion: no-preference) { button, .btn { transition: background-color .15s, border-color .15s; } }
input::placeholder, textarea::placeholder { color: #9AA5A0; font-weight: 400; }

/* премия за месяц на главной (Алексей, 10.11.2026) */
.premium { width: 100%; display: grid; gap: 2px; text-align: left; justify-items: start; justify-content: start; padding: 14px 18px; min-height: 0;
  background: var(--brand2-ink); color: #fff; border: none; border-radius: 18px; }
.premium .pl { font-size: 14px; font-weight: 500; opacity: .9; }
.premium .pv { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.premium .ps { font-size: 13px; font-weight: 400; opacity: .9; }

/* экраны руководителя (10.11.2026) */
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.shiftnow { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.okline { color: var(--accent-text); }
.badline { color: var(--bad); font-weight: 600; }
.badtxt { color: var(--bad); }
.warntxt { color: var(--warn); }
.kpi { gap: 2px; }
.kpi strong { font-size: 20px; }
.att { display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 9px 0 9px 12px; border: none;
  border-left: 4px solid var(--line); background: none; font: inherit; color: var(--ink); width: 100%; min-height: 0;
  border-radius: 0; justify-content: flex-start; align-items: flex-start; cursor: default; }
button.att { cursor: pointer; }
.att.red { border-left-color: var(--bad); }
.att.amber { border-left-color: #E08A00; }
.att .at { font-size: 14px; font-weight: 600; }
.att .as { font-size: 13px; color: var(--muted); font-weight: 400; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; justify-items: start; justify-content: start; text-align: left; min-height: 92px;
  padding: 14px; border-radius: 16px; border: none; font: inherit; }
.tile .tl { font-size: 13px; font-weight: 500; }
.tile .tv { font-size: 20px; font-weight: 700; }
.tile .ts { font-size: 12px; font-weight: 400; }
.tile.crimson { background: var(--brand2-ink); color: #fff; }
.tile.teal { background: var(--accent); color: #fff; }
.tile.plain { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tile.plain .tl, .tile.plain .ts { color: var(--muted); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.flag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #E7EBE9; color: var(--muted); }
.flag.red { background: var(--bad-soft); color: var(--bad); }
.flag.amber { background: var(--warn-soft); color: var(--warn); }
.rowbtn { width: 100%; background: none; border: none; border-bottom: 1px solid var(--line); border-radius: 0; font: inherit;
  color: var(--ink); text-align: left; min-height: 0; justify-content: flex-start; padding: 12px 0; font-weight: 400; }
.li.col { flex-direction: column; align-items: stretch; gap: 6px; }

/* заготовки разделов других должностей (11.11.2026) */
.plan { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.list.flat { box-shadow: none; padding: 0; }

/* приглашение: крупное предупреждение (10.11.2026) */
.warnbig { background: #FDE7EC; color: var(--brand2-ink, #C8153F); border: 2px solid #E51A4B; border-radius: 12px;
  padding: 12px 14px; font-size: 17px; font-weight: 800; line-height: 1.3; }

/* сторож партии WB (11.11.2026): на компьютере склада — шире, крупные номера */
body.wide main { max-width: 980px; }
.pill.ok { background: #E1F3E8; color: #1D7A45; }
.supply { display: grid; gap: 8px; }
.supply.hasbad { box-shadow: 0 0 0 2px var(--bad), var(--shadow); }
.meter { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #E7EBE9; }
.meter i { display: block; height: 100%; }
.m-ok { background: #1D9A55; } .m-wait { background: var(--brand); } .m-bad { background: var(--bad); }
.counts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; font-variant-numeric: tabular-nums; }
.probs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.prob { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  background: var(--bad-soft); border-radius: 12px; padding: 12px 14px; }
.pnum { font: 800 34px/1 ui-monospace, Consolas, monospace; color: var(--bad); letter-spacing: .02em; }
.pwhat { font-weight: 800; color: var(--bad); font-size: 16px; }
.pbody { display: grid; gap: 3px; min-width: 0; }

/* «Нет зелёного» (11.11.2026) */
.missing { border-top: 1px dashed var(--accent-line, #BFE3E8); padding-top: 8px; display: grid; gap: 6px; }
.missing summary { cursor: pointer; }
.mgrid { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mgroup { flex-basis: 100%; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.mchip { font: 700 17px/1 ui-monospace, Consolas, monospace; padding: 6px 9px; border-radius: 8px;
  background: #E7EBE9; color: var(--ink, #18282B); font-variant-numeric: tabular-nums; }
.mchip.wait { background: var(--warn-soft); color: var(--warn); }

/* текст приглашения — виден сразу, выделяется (11.11.2026) */
.invmsg { width: 100%; font: 14px/1.4 inherit; padding: 10px 12px; border: 1.5px solid var(--brand); border-radius: 12px;
  background: var(--card); color: inherit; resize: vertical; }

/* полный номер стикера (11.11.2026): первая часть мельче, последние цифры крупно */
.mchip small, .pnum small { font-size: .72em; font-weight: 600; opacity: .8; }
.pnum { display: grid; justify-items: start; }
.pnum span { display: grid; line-height: 1.05; }
.mchip span { display: inline; }

/* «Установить на телефон» (11.11.2026) */
.card.install { border: 2px solid var(--brand); display: grid; gap: 8px; }
.card.install p { margin: 0; }
.isteps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.card.install.ok { border-color: #1D9A55; }
