/* Приложение ICG OPS (ADR-008). Цвета и размеры — по утверждённым макетам (docs/08-app.md). */
:root {
  --navy: #0f1b33;
  --navy-2: #1c2b4a;
  --amber: #f5a31a;
  --ground: #f3f4f6;
  --surface: #fff;
  --ink: #101828;
  --muted: #4a5365;
  --line: #e1e4ea;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ground); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { min-height: 100%; display: flex; flex-direction: column; }
.head { background: var(--navy); color: #fff; padding: 20px 16px; padding-top: calc(20px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; }
.head h1 { margin: 0; font-size: 22px; font-weight: 800; flex: 1; }
.head .who { font-size: 13px; color: #c7ceda; }
.head .who::first-letter { text-transform: uppercase; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--amber); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.note { color: var(--muted); text-align: center; padding: 48px 24px; }
.btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--amber); color: var(--navy); font-family: inherit; font-weight: 700; font-size: 16px; }
.tabs { background: var(--surface); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); position: sticky; bottom: 0; }
.tabs button { flex: 1; min-height: 60px; border: 0; background: none; color: #667085; font-family: inherit; font-weight: 600; font-size: 12px; }
.tabs button[aria-current="page"] { color: var(--navy); box-shadow: inset 0 3px 0 var(--amber); }

/* Общие части */
.head.col { flex-direction: column; align-items: stretch; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid #44516b; background: none; color: #e4e8f0; font-family: inherit; font-weight: 600; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--navy); }
.label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.note.small { padding: 16px; margin: 0; font-size: 14px; }
.btn.small { min-height: 44px; font-size: 14px; border-radius: 12px; }
.banner { background: #fbe9e7; border: 1px solid #e9b4ae; color: #5e1610; border-radius: 14px; padding: 12px 14px; font-weight: 600; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 84px; z-index: 30; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; text-align: center; }
textarea, input[type="date"] { width: 100%; border: 1px solid #c9ced8; border-radius: 12px; padding: 12px; font-family: inherit; font-size: 16px; line-height: 1.4; color: var(--ink); background: #fff; resize: none; }

/* План */
.week { display: flex; gap: 6px; }
.week button { flex: 1; min-height: 52px; border: 0; border-radius: 12px; background: var(--navy-2); color: #c7ceda; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: inherit; font-size: 11px; }
.week button b { font-size: 16px; font-weight: 600; }
.week button.today { box-shadow: inset 0 -3px 0 var(--amber); }
.week button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.progress { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.bar { flex: 1; display: flex; gap: 3px; height: 8px; }
.bar span { border-radius: 4px; }
.bar .done { background: #1f7a4d; } .bar .ongoing { background: #1b4fa8; } .bar .not_done { background: #b3261e; } .bar .rest { background: #d5d9e0; }
.card.list { padding: 0; overflow: hidden; }
.item { width: 100%; min-height: 52px; padding: 12px 14px; display: flex; align-items: flex-start; gap: 12px; border: 0; border-bottom: 1px solid #eceef2; background: none; text-align: left; font: inherit; color: inherit; }
.item .mark { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid #98a1b2; color: #fff; display: flex; align-items: center; justify-content: center; }
.item .body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item .text { overflow-wrap: anywhere; }
.item .meta, .sheet-body .meta { font-size: 12px; font-weight: 500; color: var(--muted); }
.item .reason { font-size: 13px; color: #5e1610; overflow-wrap: anywhere; }
.st-done .mark { background: #1f7a4d; border-color: #1f7a4d; } .st-done .text { color: var(--muted); } .st-done .meta { color: #17603c; }
.st-ongoing .mark { background: #1b4fa8; border-color: #1b4fa8; } .st-ongoing .meta { color: #163f86; }
.st-not_done .mark { background: #b3261e; border-color: #b3261e; } .st-not_done .meta, .st-not_marked .meta { color: #8a1c14; }
.add { display: flex; align-items: flex-end; gap: 8px; padding: 8px; }
.add textarea { border: 0; padding: 10px 6px; max-height: 160px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags span { font-size: 13px; background: #eceef2; border-radius: 8px; padding: 5px 10px; }
.tags .blue { background: #e8eef9; color: #163f86; }

/* Лист отметки */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(15, 27, 51, 0.55); display: flex; align-items: flex-end; }
.panel { width: 100%; max-height: 92%; overflow: auto; background: #fff; border-radius: 24px 24px 0 0; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); }
.grip { display: block; width: 100%; height: 28px; border: 0; background: none; position: relative; }
.grip::after { content: ""; position: absolute; left: 50%; top: 12px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #c9ced8; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }
.sheet-body h2 { margin: 0; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.marks { display: flex; gap: 8px; }
.marks button { flex: 1; min-height: 64px; border-radius: 14px; border: 1px solid #c9ced8; background: #fff; font-family: inherit; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.m-done { color: #17603c; } .m-ongoing { color: #163f86; } .m-not_done { color: #8a1c14; }
.marks button[aria-pressed="true"] { border-width: 2px; border-color: currentColor; background: #f3f4f6; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picks button { min-height: 48px; border-radius: 12px; border: 1px solid #c9ced8; background: #fff; color: var(--ink); font-family: inherit; font-weight: 500; font-size: 14px; }
.picks button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.links { display: flex; justify-content: center; gap: 24px; border-top: 1px solid #eceef2; }
.links button { min-height: 44px; border: 0; background: none; color: #1b4fa8; font-family: inherit; font-weight: 600; font-size: 14px; }
.links .danger { color: #8a1c14; }

/* Вопросы дня, «Сьогодні» */
.grow { flex: 1; min-width: 0; }
.section { margin: 6px 0 -4px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hint { font-weight: 400; }
.label.pad { padding: 12px 14px 4px; }
.card.warn { border-color: #f0c36a; }
.card.ask { background: #fff4dc; border-color: #f0c36a; display: flex; flex-direction: column; gap: 10px; font-weight: 600; }
.banner.row { gap: 12px; }
.ghost { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #c9ced8; background: #fff; color: var(--ink); font-family: inherit; font-weight: 600; font-size: 14px; }
.link { min-height: 44px; margin: -12px 0; border: 0; background: none; color: #1b4fa8; font-family: inherit; font-weight: 600; font-size: 13px; }
.outline { min-height: 48px; border-radius: 12px; border: 1px solid #c9ced8; background: #fff; color: var(--ink); font-family: inherit; font-weight: 600; font-size: 14px; }
.outline.danger { color: #8a1c14; }
.tags button { font-family: inherit; font-size: 13px; border: 0; border-radius: 8px; padding: 5px 10px; min-height: 32px; }
.ask-row { width: 100%; min-height: 60px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-family: inherit; font-size: 15px; }
.ask-row.strong { background: #fff4dc; border-color: #f0c36a; }
.ask-row .body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ask-row .meta { font-size: 13px; color: #5c4200; }
.ask-row:not(.strong) .meta { color: var(--muted); }
.chev { font-size: 24px; color: var(--muted); }
.card.object { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; font-family: inherit; font-size: 15px; color: var(--ink); }
.card.object .name { font-size: 17px; }
.card.object .meta { font-size: 13px; color: var(--muted); }
.card.object .reason { font-size: 13px; color: #5e1610; }
.card.object > * { width: 100%; }
.card.object .bar { flex: none; height: 8px; }

/* Задачі */
.head.row { gap: 4px; }
.back { width: 44px; height: 44px; margin-left: -10px; border: 0; background: none; color: #fff; font-size: 30px; line-height: 1; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--navy-2); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; color: #c7ceda; font-family: inherit; font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.section.g-pending { color: #5c4200; } .section.g-overdue { color: #8a1c14; }
.card.task { display: flex; flex-direction: column; gap: 10px; }
.card.task.pending { border-color: #f0c36a; } .card.task.late { border-color: #e9b4ae; }
.task-main { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; font-family: inherit; font-size: 15px; color: var(--ink); }
.task-main b { line-height: 1.3; overflow-wrap: anywhere; }
.task-main .meta, .card > .meta, .person .meta, .event .meta { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-s { font-size: 12px; font-weight: 600; color: var(--muted); background: #eceef2; border-radius: 8px; padding: 3px 8px; }
.chip-s.red { color: #8a1c14; background: #fbe9e7; } .chip-s.amber { color: #5c4200; background: #fff4dc; }
.grow2 { flex: 2; }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 10; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--amber); color: var(--navy); font-size: 32px; line-height: 1; box-shadow: 0 6px 16px rgba(15, 27, 51, 0.28); }
.title { margin: 0 0 6px; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.card > .chips { margin-top: 10px; }
.plain { margin: 6px 0 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eceef2; }
.person .body, .event .body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; background: #eceef2; color: var(--muted); }
.a-accepted .avatar, .a-confirmed .avatar { background: #ddf0e5; color: #17603c; } .a-accepted .meta { color: #17603c; }
.a-pending .avatar { background: #fff4dc; color: #5c4200; } .a-pending .meta { color: #5c4200; }
.a-declined .meta { color: #8a1c14; }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.event { display: flex; gap: 12px; font-size: 14px; }
.event .dot { width: 10px; height: 10px; margin-top: 5px; flex: none; border-radius: 50%; background: #98a1b2; }
.event.counted .dot { background: #b3261e; }
.event .reason { color: #5e1610; }
.who-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid #c9ced8; background: #fff; color: var(--ink); font-family: inherit; font-weight: 600; font-size: 14px; }
.pill[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.check input { width: 24px; height: 24px; accent-color: var(--navy); }

/* Работа на объект: метка объекта и переключатель «Людині / На об'єкт» в форме */
.chip-s.navy { color: #fff; background: var(--navy); }
.seg.light { background: #e4e7ed; }
.seg.light button { color: var(--muted); }
.seg.light button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* Фото: выбор, лента, просмотр */
.photo-pick { display: flex; flex-direction: column; gap: 6px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #e4e7ed; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.broken { opacity: 0.4; }
.photo-full { position: fixed; inset: 0; z-index: 50; border: 0; padding: 0; background: rgba(10, 16, 30, 0.94); display: flex; align-items: center; justify-content: center; }
.photo-full img { max-width: 100%; max-height: 100%; }

/* Стрічка: навигация по дням, причины несделанного */
.datenav { display: flex; gap: 6px; }
.datenav button { min-height: 44px; min-width: 44px; border: 0; border-radius: 12px; background: var(--navy-2); color: #fff; font-family: inherit; font-weight: 600; font-size: 14px; }
.datenav button.grow { flex: 1; }
div.item { cursor: default; }
.fail { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid #eceef2; }
.fail:last-child, .card.list > div.item:last-child { border-bottom: 0; }
.fail .reason { font-size: 13px; color: #5e1610; overflow-wrap: anywhere; }
/* Зведення: счётчики, карточки людей и объектов */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: #fff; border-radius: 14px; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 26px; font-weight: 800; line-height: 1; }
.tile span { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile.red b { color: #b3261e; } .tile.amber b { color: #8a5a00; }
.chip-s.green { color: #14532d; background: #e3f3ea; }
.sum-card { padding: 0; overflow: hidden; }
.sum-head { width: 100%; padding: 14px; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.sum-group { margin: 0; padding: 10px 14px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-top: 1px solid #eceef2; }
.sum-group.red { color: #8a1c14; } .sum-group.amber { color: #5c4200; } .sum-group.green { color: #14532d; }
.sum-row { width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.sum-row .meta { font-size: 12px; color: var(--muted); }
.sum-row .reason { font-size: 13px; color: #5e1610; overflow-wrap: anywhere; }

/* Керування: люди, объекты, новость */
.person-row, .role-row { width: 100%; min-height: 56px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid #eceef2; background: none; text-align: left; font: inherit; color: var(--ink); }
.person-row:last-child, .role-row:last-child { border-bottom: 0; }
.person-row .body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-row .meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.role-row.k-planner .chip-s { color: #fff; background: #1b4fa8; }
.role-row.k-senior .chip-s { color: #3d2a00; background: var(--amber); }
.news summary { font-weight: 600; cursor: pointer; }
.plain.pre { white-space: pre-wrap; }
