/* Стиль в духе интерфейса Битрикс24 */
:root {
    --text: #333;
    --muted: #828b95;
    --line: #e6e9ec;
    --bg-soft: #f5f7f8;
    --accent: #2fc6f6;
    --accent-dark: #11a9d8;
    --old: #c0392b;
    --old-bg: #fdf0ef;
    --new: #1e8e3e;
    --new-bg: #eef8f0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    font: 14px/1.45 "Open Sans", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: #fff;
}
h1 { font-size: 22px; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.page { max-width: 760px; padding: 24px; }
.muted { color: var(--muted); }
.error { color: var(--old); }
.card { background: var(--bg-soft); border-radius: 8px; padding: 12px 16px; }
.card p { margin: 4px 0; }

.tab { padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.toolbar .spacer { flex: 1; }
select, input[type=search] {
    height: 34px; padding: 0 10px; border: 1px solid #c6cdd3; border-radius: 4px;
    font: inherit; background: #fff; color: var(--text); min-width: 150px;
}
input[type=search] { min-width: 200px; }
.btn {
    height: 34px; padding: 0 16px; border: 1px solid #c6cdd3; border-radius: 4px;
    background: #fff; color: var(--text); font: inherit; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
#summary { margin: 4px 0 10px; font-size: 13px; }
.state { padding: 32px; text-align: center; color: var(--muted); background: var(--bg-soft); border-radius: 8px; }

.small { font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.notice { background: #fff6e5; color: #8a5a00; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.ok-msg { background: var(--new-bg); color: var(--new); border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.err-msg { background: var(--old-bg); color: var(--old); border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.page { max-width: 1200px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.danger { color: var(--old); border-color: #f1c4c0; }
.danger:hover { color: #fff; background: var(--old); border-color: var(--old); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { border: 0; background: none; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.ava { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
.ava.ini { display: inline-flex; align-items: center; justify-content: center; background: #dfe5ea; color: #525c69; font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 11px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.none { background: #f1f3f5; color: var(--muted); font-weight: 400; }
.note { font-size: 12px; color: #525c69; overflow-wrap: anywhere; }

/* история */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.grid .num { text-align: right; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.toolbar input[type=month] { height: 34px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; }
.box { background: var(--bg-soft); border-radius: 10px; padding: 14px 16px; }
.box p { margin: 0 0 8px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 6px 0; }
.check input { width: 16px; height: 16px; }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font: inherit; color: var(--muted); flex: none; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.toolbar input[type=date], .toolbar select { height: 34px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; }
.warn { color: var(--old); font-weight: 600; }
h3 { font-size: 15px; margin: 22px 0 10px; }
.link { border: 0; background: none; color: #2067b0; font: inherit; font-size: 13px; padding: 4px 0; cursor: pointer; border-bottom: 1px dashed #2067b0; align-self: flex-start; }

/* запросы */
.reqs { display: flex; flex-direction: column; gap: 10px; }
.req { border: 1px solid var(--line); border-left: 4px solid #a8b3bd; border-radius: 10px; padding: 12px 16px; background: #fff; }
.req.wait { border-left-color: #ffb400; }
.req.ok { border-left-color: #2fbf71; }
.req.bad { border-left-color: #fa5252; }
.rhead { display: flex; align-items: center; gap: 8px; }
.rnum { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.wait { background: #fff4d6; color: #a86b00; }
.badge.ok { background: #e3f7ea; color: #1f8a4c; }
.badge.bad { background: #fde8e8; color: #c92a2a; }
.badge.gray { background: #f1f3f5; color: var(--muted); }
.ent { margin-top: 6px; font-size: 13px; }
.ent a { color: #2067b0; }
.rtitle { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ramount { font-size: 18px; font-weight: 700; margin-top: 4px; }
.route { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rstep { display: flex; gap: 10px; align-items: flex-start; }
.rmark { width: 22px; height: 22px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #edf0f2; color: var(--muted); }
.rstep.yes .rmark { background: #2fbf71; color: #fff; }
.rstep.no .rmark { background: #fa5252; color: #fff; }
.rstep.now .rmark { background: #ffb400; color: #fff; }
.rstep.skip, .rstep.future { opacity: .6; }
.rbody { min-width: 0; line-height: 22px; }
.rcomment { font-size: 13px; color: #525c69; line-height: 1.4; overflow-wrap: anywhere; }
.decide { margin-top: 12px; }
.decide textarea, .newreq textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; resize: vertical; }
.btn.yes { background: #2fbf71; border-color: #2fbf71; color: #fff; font-weight: 600; }
.btn.no { background: #fff; border-color: #fa5252; color: #e03131; font-weight: 600; }
.deputy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.deputy input[type=date] { height: 30px; padding: 0 6px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; }

/* новый запрос */
.newreq { background: var(--bg-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.kchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kchip { height: 32px; padding: 0 14px; border: 1px solid #c6cdd3; border-radius: 16px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.kchip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fl { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fl > span { font-size: 12px; color: var(--muted); }
.frow { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.fl.amt input { width: 180px; height: 36px; padding: 0 10px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; }
.whohint { margin-bottom: 18px; }
.place h2 { margin-top: 0; }

/* отчёт */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile { background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; }
.tile.ok .tnum { color: #1f8a4c; }
.tile.bad .tnum { color: #c92a2a; }
.tile.wait .tnum { color: #a86b00; }
.tnum { font-size: 26px; font-weight: 700; }

/* настройки */
.klist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.krow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.krow.off { opacity: .55; }
.editor { background: var(--bg-soft); border-radius: 10px; padding: 14px 16px; margin: 8px 0; }
.erow { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.erow input[type=text] { flex: 1; min-width: 160px; height: 36px; padding: 0 10px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; }
.erow input.emoji { flex: none; width: 60px; min-width: 0; text-align: center; font-size: 18px; }
.erow input.num-in { flex: none; width: 140px; min-width: 0; }
.erow select, .steps select { height: 36px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; }
.steps { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding-left: 4px; }
.steps .srow { display: flex; align-items: center; gap: 8px; }
.snum { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
@media (max-width: 640px) { .frow { flex-direction: column; align-items: stretch; } .fl.amt input { width: 100%; } }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tab { white-space: nowrap; }
@media (max-width: 640px) { .rhead { flex-wrap: wrap; } .deputy .grow { flex-basis: 100%; } }
