/* ============================================================
   Screen 4 — Разбор отклонения (Специалист / Координатор)
   ============================================================ */

/* Prevent body scroll — layout is fully contained */
body { overflow: hidden; }

/* Alert workspace header */
.alert-workspace-header {
  background: var(--amber-l);
  border-bottom: 1px solid var(--amber-m);
  padding: 16px 28px;
  display: flex; align-items: flex-start; gap: 16px;
}
.awh-indicator {
  width: 4px; border-radius: 2px;
  background: var(--amber);
  align-self: stretch; flex-shrink: 0;
}
.awh-body { flex: 1; min-width: 0; }
.awh-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--amber);
  margin-bottom: 4px;
}
.awh-title {
  font-size: 17px; font-weight: 700; color: var(--text-1);
  margin-bottom: 8px; line-height: 1.3;
}
.awh-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.awh-meta-item { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.awh-meta-label { color: var(--text-3); font-weight: 600; }

/* Workflow strip */
.wf-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center;
}

/* Two-column deviation layout */
.deviation-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}
.deviation-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 24px 28px;
  overflow-y: auto;
  overflow-x: hidden;
}
.deviation-right {
  width: 340px;
  flex-shrink: 0;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Evidence timeline */
.evidence-timeline { display: flex; flex-direction: column; gap: 0; }
.ev-item {
  display: flex; gap: 14px;
  padding-bottom: 16px;
  position: relative;
}
.ev-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px; top: 26px; bottom: 0;
  width: 2px; background: var(--border);
}
.ev-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; z-index: 1;
}
.ev-content { flex: 1; padding-top: 2px; }
.ev-label { font-size: 12px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.ev-desc { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.ev-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* Decision options */
.decision-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.1s, background 0.1s;
  background: var(--surface);
  max-width: 100%;
  min-width: 0;
}
.decision-option:hover { border-color: var(--blue-m); background: var(--blue-l); }
.decision-option.selected,
.decision-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-l);
}
.do-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
  transition: border-color 0.1s;
}
.decision-option.selected .do-radio,
.decision-option:has(input:checked) .do-radio {
  border-color: var(--blue);
}
.do-radio-fill {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); display: none;
}
.decision-option.selected .do-radio-fill,
.decision-option:has(input:checked) .do-radio-fill {
  display: block;
}
.do-name { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; overflow-wrap: break-word; word-break: normal; }
.do-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; overflow-wrap: break-word; word-break: normal; }
.do-body { min-width: 0; }

/* Plan compare */
.plan-compare {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  max-width: 100%;
  min-width: 0;
}
.plan-card {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  overflow-wrap: break-word;
  word-break: normal;
  overflow: hidden;
}
.plan-card.new { background: var(--green-l); border-color: var(--green-m); }
.plan-card-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 10px;
}
.plan-card.new .plan-card-label { color: var(--green); }
.plan-task-name { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; overflow-wrap: break-word; word-break: normal; }
.plan-task-detail { font-size: 12px; color: var(--text-2); line-height: 1.5; overflow-wrap: break-word; word-break: normal; }
.plan-arrow { font-size: 24px; color: var(--text-3); text-align: center; flex-shrink: 0; width: 24px; }
.plan-reason {
  background: var(--blue-l); border: 1px solid var(--blue-m);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 14px;
  max-width: 100%;
  min-width: 0;
}
.plan-reason-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue); margin-bottom: 5px; }
.plan-reason-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* Журнал действий */
.audit-entry {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.audit-entry:last-child { border-bottom: none; }
.audit-time { font-size: 11px; color: var(--text-3); width: 80px; flex-shrink: 0; font-variant-numeric: tabular-nums; padding-top: 1px; }
.audit-text { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.audit-actor { font-weight: 600; color: var(--text-1); }

/* Right panel */
.rp-section-divider { height: 1px; background: var(--border); margin: 16px 0; }
/* Related tasks */
.related-task {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.related-task:last-child { border-bottom: none; }
.rt-date { font-size: 11px; color: var(--text-3); width: 80px; flex-shrink: 0; }
.rt-name { font-size: 13px; color: var(--text-1); flex: 1; font-weight: 500; }

/* Required actions checklist */
.req-action {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.req-action:last-child { border-bottom: none; }
.req-check {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.req-check-box {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.req-check.checked,
.req-check:has(input:checked) {
  background: var(--blue); border-color: var(--blue);
}
.req-check.checked .req-check-box .icon,
.req-check:has(input:checked) .req-check-box .icon {
  color: #fff;
}
.req-text { font-size: 13px; color: var(--text-1); font-weight: 500; }

/* ---- Inline-style replacements ---- */

/* Sidebar */
/* Workflow */
.wf-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin-right: 20px;
  white-space: nowrap;
}

/* Cards in deviation main */
.deviation-main > .card { margin-bottom: 20px; overflow: hidden; width: 100%; min-width: 0; }
.deviation-main .card-body { min-width: 0; }

/* Evidence dots */
.ev-dot.amber { background: var(--amber-l); border: 2px solid var(--amber-m); }
.ev-dot.amber .icon { color: var(--amber); }
.ev-dot.teal  { background: var(--teal-l); border: 2px solid #99F6E4; }
.ev-dot.teal  .icon { color: var(--teal); }
.ev-dot.blue  { background: var(--blue-l); border: 2px solid var(--blue-m); }
.ev-dot.blue  .icon { color: var(--blue); }
.ev-dot.green { background: var(--green-l); border: 2px solid var(--green-m); }
.ev-dot.green .icon { color: var(--green); }

/* Card header note */

/* Plan adjustment */
.plan-task-detail.positive { color: var(--green); }
.req-section { margin-top: 16px; }
.req-section-title { font-size: 12px; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.plan-actions { margin-top: 16px; display: flex; gap: 10px; }
.btn-ghost-danger { margin-left: auto; color: var(--red); }

/* Right panel */
.rp-content { padding: 20px 18px; display: flex; flex-direction: column; gap: 0; }
.sparkline-wrap { margin-top: 10px; }
.sparkline-label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.sparkline-bars { display: flex; gap: 4px; align-items: flex-end; height: 28px; }
.sparkline-bar {
  flex: 1; border-radius: 2px 2px 0 0;
  height: var(--h);
}
.sparkline-bar.green { background: var(--green); opacity: 0.5; }
.sparkline-bar.amber { background: var(--amber); }
.sparkline-bar.amber-dim { background: var(--amber); opacity: 0.6; }
.sparkline-bar.amber-dimmer { background: var(--amber); opacity: 0.7; }
.sparkline-caption { font-size: 10px; color: var(--text-3); margin-top: 3px; text-align: right; }

/* Team */
.team-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.team-avatar.amber { background: var(--amber-l); color: var(--amber); }
.team-avatar.teal  { background: var(--teal-l); color: var(--teal); }
.team-avatar.blue  { background: var(--blue-l); color: var(--blue); }
.team-role  { font-size: 10px; color: var(--text-3); }

/* Visit card */
.visit-note  { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Журнал действий */
.audit-list { display: flex; flex-direction: column; gap: 0; }
.audit-entry.pending { border: none; }
.audit-entry.pending .audit-time { color: var(--amber); }
.audit-entry.pending .audit-text { color: var(--amber); }

/* Quick action icon colors */
/* Responsive */
