/* Кабинет менеджера: одна колонка на телефоне, крупные поля; без внешних шрифтов и библиотек */
:root {
  /* стиль АРЕОНСТИЛ (areonsteel.ru): бирюзовый акцент, тёмно-серая полоса меню, белые карточки на светло-сером */
  --bg: #f4f5f6; --card: #fff; --text: #222; --muted: #6b7280; --line: #e2e5e9;
  --accent: #19a2b2; --accent-2: #1593a2; --accent-dark: #127f8c; --accent-bg: #e8f6f8; --bar: #3c3c3c;
  --ok: #2e8b3a; --ok-bg: #eaf6ec; --bad: #c62828; --bad-bg: #fdecea; --warn-bg: #fff8e1; --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.45 Roboto, "Segoe UI", -apple-system, Arial, sans-serif; }
a { color: var(--accent-2); }
h1 { font-size: 1.5rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
main { max-width: 860px; margin: 0 auto; padding: 12px 16px 48px; }
.top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
       background: var(--accent); color: #fff; padding: 10px 16px; }
.top a, .top .link { color: #fff; text-decoration: none; }
.brand { font-weight: 700; letter-spacing: .02em; }
.brand span { font-weight: 400; opacity: .8; margin-left: 6px; }
.top nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
        margin: 12px 0; }
.narrow { max-width: 420px; margin: 32px auto; }
.muted { color: var(--muted); font-size: .92rem; }
.lead { color: var(--muted); }
.crumbs { font-size: .9rem; color: var(--muted); margin: 4px 0; }
.ok { background: var(--ok-bg); color: var(--ok); padding: 10px 12px; border-radius: 8px; }
.bad { color: var(--bad); }
p.bad { background: var(--bad-bg); padding: 10px 12px; border-radius: 8px; }
.hidden { display: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
input, textarea, select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
                          background: #fff; color: inherit; width: 100%; min-height: 44px; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: var(--accent-2); }
input[type=radio] { width: 20px; height: 20px; min-height: 0; margin: 0 8px 0 0; flex: none; }
input[type=file] { padding: 8px; background: #fafbfc; }
.button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
                  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
                  color: var(--text); font: inherit; text-decoration: none; cursor: pointer; text-align: center; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #173d60; }
.big { font-size: 1.05rem; padding: 12px 24px; }
.small { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
.danger { color: var(--bad); border-color: #f0b4ae; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; margin: 0; }
.tile:hover { border-color: var(--accent-2); }
.list { padding-left: 20px; }
pre.text { white-space: pre-wrap; font: inherit; margin: 0; }
.questions { padding-left: 24px; margin: 0; }

/* отправки */
.sends { list-style: none; padding: 0; margin: 0; }
.send { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; background: var(--card);
        border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 8px 12px;
        margin: 6px 0; }
.send .when { color: var(--muted); font-size: .9rem; }
.send .state { font-weight: 600; }
.st-done { border-left-color: var(--ok); }
.st-failed, .st-expired { border-left-color: var(--bad); }
.st-failed .state, .st-expired .state { color: var(--bad); }
.st-queued, .st-running { border-left-color: #c58a00; }

/* форма */
.section { border: 1px solid var(--line); min-width: 0; }  /* fieldset: иначе длинное поле раздвигает карточку */
/* заголовок раздела — внутри карточки, а не на её рамке (float выводит legend из рамки fieldset) */
.section legend { float: left; width: 100%; padding: 0 0 4px; margin: 0; font-weight: 700; color: var(--accent);
                  font-size: 1.05rem; }
.section legend + * { clear: both; }
.field { padding: 10px 0; border-top: 1px solid #eef1f5; }
.field:first-of-type { border-top: 0; }
.field .label { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 4px; }
.field .name { font-weight: 600; }
.req-mark { font-size: .78rem; color: var(--bad); border: 1px solid #f0b4ae; border-radius: 10px; padding: 0 7px; }
.req-mark[data-cond] { display: none; }
.field.need-on .req-mark[data-cond] { display: inline; }
.now { font-size: .88rem; color: var(--ok); margin-bottom: 4px; }
.hint { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.err { font-size: .88rem; color: var(--bad); margin-top: 4px; }
.field.bad { background: var(--bad-bg); margin: 0 -10px; padding: 10px; border-radius: 8px; }
.field.bad input, .field.bad textarea { border-color: var(--bad); }
.options { display: flex; flex-direction: column; gap: 6px; }
.option { display: flex; align-items: center; min-height: 40px; padding: 4px 10px; border: 1px solid var(--line);
          border-radius: 8px; background: var(--warn-bg); cursor: pointer; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.alert { border-color: var(--bad); background: var(--bad-bg); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.hint-box { background: var(--warn-bg); }
.submit { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; position: sticky; bottom: 0; z-index: 1;
          background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line);
          box-shadow: 0 -6px 12px -8px rgba(29, 39, 51, .25); }

/* логины */
.users { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); }
.users th, .users td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .78rem; background: #e8eef6; color: var(--accent); border-radius: 10px; padding: 0 7px; }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }

@media (max-width: 600px) {
  main { padding: 8px 12px 40px; }
  h1 { font-size: 1.3rem; }
  .card { padding: 12px; }
  .actions .button { width: 100%; }
  .submit { flex-wrap: nowrap; }
  .submit button { flex: 2; }
  .submit .button { flex: 1; }
  .users thead { display: none; }
  .users tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .users td { display: block; border: 0; padding: 4px 10px; }
}

/* шаги формы, терминалы списком, свёрнутые поля, ожидание разбора */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 4px 0 8px; counter-reset: step; font-size: .92rem; }
.steps li { counter-increment: step; color: var(--muted); padding: 4px 10px; border-radius: 14px; background: #e9edf3; }
.steps li::before { content: counter(step) ". "; }
.steps li.on { background: var(--accent); color: #fff; }
.steps li.done { background: var(--ok-bg); color: var(--ok); }
.opt-note { color: var(--muted); font-size: .88rem; }
.option span { line-height: 1.3; }
.options input[type=text] { margin-top: 2px; }
details.more { padding: 0; }
details.more > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--accent); }
details.more[open] > summary { border-bottom: 1px solid var(--line); }
details.more > :not(summary) { margin-left: 16px; margin-right: 16px; }
details.more > .section { border: 0; padding-left: 0; padding-right: 0; }
details.more h3 { color: var(--accent); }
.spin::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
                border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
                animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* файлы — плитками: по нескольку в ряд, на телефоне — по одной-две */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.file-grid .field { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0;
                    display: flex; flex-direction: column; gap: 4px; background: #fbfcfd; }
.file-grid .field.bad { margin: 0; }
.file-grid .field .label { margin-bottom: 2px; }
.file-grid input[type=file] { font-size: .85rem; padding: 6px; min-height: 0; margin-top: auto; color: transparent; }
.file-grid input[type=file]::file-selector-button { color: var(--text); }
.picked { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.picked.has { color: var(--ok); font-weight: 600; }
.file-grid .hint { margin-top: 0; }
@media (max-width: 600px) { .file-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

.parse { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; }
.file-grid .field.all { grid-column: 1 / -1; background: #eef4fb; border: 1px dashed var(--accent-2); }
.file-grid .field.all .name { color: var(--accent); }

/* --- поля формы: строки, дата и время раздельно, списки (28.10.2026) --- */
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; align-items: start;
       border-top: 1px solid #eef1f5; }
.row > .field { border-top: 0; }
.field .label { align-items: center; }
.code { color: var(--muted); font-weight: 600; font-size: .85rem; margin-right: 4px; }
.now { font-size: .82rem; color: var(--ok); background: var(--ok-bg); border-radius: 10px; padding: 1px 8px; margin: 0;
       max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.group .grow { flex: 1 1 220px; width: auto; }
.sub { display: flex; flex-direction: column; gap: 3px; font-weight: 400; }
.sub-l { font-size: .8rem; color: var(--muted); text-transform: lowercase; }
input.w-date { width: 175px; }            /* значок календаря — у самого поля, а не у правого края карточки */
input.w-time { width: 132px; padding-left: 34px; font-variant-numeric: tabular-nums;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23687385' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") no-repeat 11px center; }
input.w-num { max-width: 180px; }
select { appearance: auto; }
.w-select { width: auto; min-width: 220px; max-width: 100%; }
.options.inline { flex-direction: row; flex-wrap: wrap; }
.options.inline .option { flex: 0 1 auto; }
.option:has(input:checked) { border-color: var(--accent-2); background: #e8f0fa; }
.check { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; }
input:disabled { background: #f1f3f6; color: var(--muted); }
.dims input { width: 92px; text-align: center; }
.dims span { color: var(--muted); align-self: center; }
.dl-city { max-width: 340px; margin-bottom: 8px; }
.dl .options { margin-bottom: 6px; }
.dl-empty { margin: 4px 0; }
@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; }
  input.w-date { width: 100%; max-width: 200px; }
  .w-select { min-width: 0; width: 100%; }
}


/* --- шапка и полоса меню в стиле АРЕОНСТИЛ --- */
.top { display: block; background: #fff; color: var(--text); padding: 0; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1000px; margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 6px 16px;
          align-items: center; justify-content: space-between; }
.top a.brand { color: var(--accent); text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; color: var(--accent); }
.brand-sub { font-size: .95rem; font-weight: 400; color: var(--muted); }
.who { color: var(--muted); font-size: .92rem; }
.bar { background: var(--bar); }
.bar-in { max-width: 1000px; margin: 0 auto; padding: 0 8px; display: flex; flex-wrap: wrap; align-items: center; }
.bar a, .bar .link { color: #fff; text-decoration: none; padding: 12px 12px; font-size: 1rem; display: inline-block; }
.bar a:hover, .bar .link:hover { color: #7fd6e0; }
main { max-width: 1000px; }
a { color: var(--accent-2); }
a:hover { color: var(--accent-dark); }
h1 { font-weight: 700; }
.card { border-color: var(--line); box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.section legend { color: var(--text); font-size: 1.12rem; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button:disabled, .button[disabled] { opacity: .5; cursor: not-allowed; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.option { background: #fff; }
.option:hover { border-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
.hint-box { background: var(--accent-bg); border-left: 4px solid var(--accent); }
.code { color: var(--accent-2); }
.file-grid .field.all { background: var(--accent-bg); border-color: var(--accent); }
.file-grid .field.all .name { color: var(--accent-dark); }
.tag { background: var(--accent-bg); color: var(--accent-dark); }
.steps li.on { background: var(--accent); }
.spin::before { border-top-color: var(--accent); }
.submit { background: var(--bg); }
@media (max-width: 600px) {
  .brand-name { font-size: 1.3rem; }
  .brand-sub { display: none; }
  .bar a, .bar .link { padding: 10px 8px; }
}
.brand-name { font-family: "Arial Black", "Segoe UI Black", Arial, sans-serif; font-weight: 900; letter-spacing: 0; }
input[type=file]::file-selector-button { font: inherit; font-size: .88rem; color: var(--accent-dark); background: #fff;
  border: 1px solid var(--accent); border-radius: 4px; padding: 5px 12px; margin-right: 8px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--accent-bg); }
