/* Стиль в духе интерфейса Битрикс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; }

.small { font-size: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.form { max-width: 760px; }
.fl { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.fl > span { font-size: 12px; color: var(--muted); }
.fl input[type=text], .fl input[type=tel], .fl input[type=url], .fl input[type=date], .fl input[type=time], .fl select, .fl textarea { height: 36px; padding: 0 10px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; box-sizing: border-box; }
.fl textarea { height: auto; padding: 8px 10px; resize: vertical; }
.fl.grow { flex: 1; min-width: 220px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; cursor: pointer; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.tile:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.tile.on { background: var(--c); color: #fff; border-color: var(--c); }
.tile.on .muted { color: rgba(255, 255, 255, .85); }
.temo { font-size: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2f4; border-radius: 14px; padding: 4px 6px 4px 12px; font-size: 13px; }
.chip.me { padding-right: 12px; background: #e5f6fd; color: #0b66c3; font-weight: 600; }
.chip.crm { background: #fff4d6; color: #7a5400; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; }
.link { border: 0; background: none; color: #2067b0; font: inherit; font-size: 13px; padding: 4px 0; cursor: pointer; border-bottom: 1px dashed #2067b0; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.done { text-align: center; padding: 30px 20px; border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 12px; max-width: 520px; }
.done .big { font-size: 40px; color: var(--c); font-weight: 800; }
.done b { display: block; font-size: 17px; margin: 6px 0; }
.done .actions { justify-content: center; }

/* список */
.toolbar input[type=date], .toolbar select { height: 34px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; }
.day { margin-bottom: 14px; }
.dayh { font-weight: 700; font-size: 13px; color: var(--muted); margin: 6px 0; }
.dayh::first-letter { text-transform: uppercase; }
.ev { display: flex; gap: 12px; padding: 8px 12px; border-left: 4px solid var(--c); background: #fff; border-radius: 6px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.evt { width: 92px; flex: none; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.evm { min-width: 0; }
.evm .crm { color: #7a5400; margin-top: 2px; }

/* отчёт */
.ktot { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.kt { border-left: 4px solid var(--c); background: var(--bg-soft); border-radius: 8px; padding: 8px 14px; min-width: 110px; }
.ktn { font-size: 24px; font-weight: 800; }

/* типы */
.klist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.krow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.krow.off { opacity: .55; }
.kdot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.editor { background: var(--bg-soft); border-left: 4px solid var(--c); 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 select, .frow select { height: 34px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; padding: 0 6px; }
.lb { font-size: 12px; color: var(--muted); }
.colors { display: flex; gap: 5px; flex-wrap: wrap; }
.col { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.col.on { border-color: #1c2533; box-shadow: 0 0 0 2px #fff inset; }
.fields { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.frow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.frow input[type=text] { height: 32px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; flex: 1; min-width: 140px; }
.frow .check { margin: 0; }
.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; }
