* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 16px;
    font: 14px/1.4 "Open Sans", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #fff;
}
h1 { font-size: 20px; margin: 0; font-weight: 600; }
.muted { color: #828b95; font-size: 13px; font-weight: normal; }
.hidden { display: none !important; }

.bar, .filters, .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar, .filters { justify-content: space-between; margin-bottom: 16px; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; margin-top: 12px; }
.row > label { flex: 1 1 200px; }

.btn {
    border: 1px solid #c6cdd3;
    background: #fff;
    border-radius: 4px;
    padding: 7px 14px;
    cursor: pointer;
    font: inherit;
}
.btn:hover { background: #f5f7f8; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: #3bc8f5; border-color: #3bc8f5; color: #fff; }
.btn.primary:hover { background: #3eddff; }
.btn.small { padding: 4px 10px; font-size: 13px; }

.card {
    border: 1px solid #e1e5e8;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #525c69; }
input, textarea, select {
    font: inherit;
    padding: 7px 9px;
    border: 1px solid #c6cdd3;
    border-radius: 4px;
    width: 100%;
}
.filters select { width: auto; min-width: 180px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
    border: none;
    background: #eef2f4;
    border-radius: 14px;
    padding: 5px 12px;
    cursor: pointer;
    font: inherit;
}
.tab.active { background: #535c69; color: #fff; }

.message { padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; background: #e5f9e0; }
.message.error { background: #ffe8e8; color: #c00; }

.tasks { list-style: none; margin: 0; padding: 0; }
.task {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #eef2f4;
}
.task a { color: #2067b0; text-decoration: none; }
.task a:hover { text-decoration: underline; }
.task.done a { color: #828b95; text-decoration: line-through; }
.task.overdue .muted { color: #d0382a; }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.empty { padding: 24px; text-align: center; }

.pages { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; border-bottom: 1px solid #eef2f4; }
.pages a { padding: 6px 0; color: #525c69; text-decoration: none; border-bottom: 2px solid transparent; }
.pages a.active { color: #333; border-bottom-color: #3bc8f5; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 13px; color: #525c69; }
#search, #my-search { width: 260px; }

.board { display: flex; flex-direction: column; gap: 10px; }
.group { border: 1px solid #e1e5e8; border-radius: 6px; padding: 0 12px; }
.group.unassigned { border-style: dashed; }
.group summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    cursor: pointer;
    list-style: none;
}
.group summary::before { content: "▸"; color: #828b95; }
.group[open] summary::before { content: "▾"; }
.group-name { font-weight: 600; }
.group .tasks { border-top: 1px solid #eef2f4; }
.group .task:last-child { border-bottom: none; }
.badge { background: #eef2f4; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.badge.danger { background: #ffe8e8; color: #d0382a; }

.task-head { display: flex; align-items: center; gap: 6px; }
.counter {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #9dcf00;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}
.counter.counter-total { background: #a8adb4; }
.counter.counter-new-muted { background: #9dcf00; opacity: .55; }
.version { margin-top: 24px; font-size: 11px; text-align: right; }

.group.mine { border-color: #3bc8f5; }
.subgroups { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 12px; border-top: 1px solid #eef2f4; }
.group.subgroup { background: #fafbfc; }

.clip {
    margin-left: auto;
    border: none;
    background: none;
    color: #828b95;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    line-height: 0;
}
.clip:hover { color: #2067b0; background: #eef2f4; }
.link-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.link-box input { flex: 1 1 260px; width: auto; }

.chat-results { border: 1px solid #c9e7f3; background: #f6fbfd; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.chat-results-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-results-head .btn { margin-left: auto; }
.snippet { margin-top: 4px; padding: 4px 8px; border-left: 3px solid #c6cdd3; color: #525c69; font-size: 13px; }
.snippet mark { background: #fff3a8; padding: 0 1px; }

.last-message {
    margin-top: 3px;
    font-size: 13px;
    color: #525c69;
    max-width: 640px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.last-message-who { color: #828b95; }
.last-message-text { font-weight: 600; font-style: italic; color: #333; }
.task-main { min-width: 0; }

.approval { font-size: 12px; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.approval-pending { background: #fff3d6; color: #8a5a00; }
.approval-approved { background: #e5f9e0; color: #2d7a17; }
.approval-returned { background: #ffeedd; color: #b35c00; }
.approval-stopped { background: #ffe8e8; color: #c00; }

.ref-card { padding: 10px 12px; }
.ref-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.route { margin: 8px 0 0; padding-left: 22px; }
.route li { margin: 2px 0; }
.ref-title { font-size: 16px; margin: 0; }
.ref-step { border: 1px solid #e1e5e8; border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ref-step .row > input { flex: 1 1 200px; width: auto; }
.ref-step-num { font-weight: 600; color: #828b95; min-width: 18px; }
.chips { gap: 6px; }
.chip { background: #eef2f4; border-radius: 12px; padding: 2px 8px; font-size: 13px; }
.chip-x { border: none; background: none; cursor: pointer; color: #828b95; padding: 0 2px; }
label.check { flex-direction: row; align-items: center; gap: 4px; flex: 0 0 auto; }
label.check input { width: auto; }
label.check select { width: auto; }

.journal-item { display: flex; flex-direction: column; gap: 6px; }
.journal-links { gap: 14px; }
.journal-hint { margin-bottom: 10px; font-size: 13px; }
.route li.step-active { background: #fff8e1; border-radius: 4px; padding: 0 4px; }
