/* ============================================================
   Screen 3 — Рабочее пространство специалиста
   ============================================================ */

/* Tab panels */
.tab-panel { transition: opacity 0.15s ease; }

/* Tab bar */
.tab-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 28px;
}
.tab {
  padding: 12px 18px;
  font-size: 13px; font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  border-radius: 4px 4px 0 0;
}
.tab:hover { color: var(--text-1); background: var(--surface-2); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 100px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; margin-left: 6px;
  vertical-align: middle;
}

/* Goal cards */
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  flex: 1;
}
.goal-name {
  font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 4px;
  min-height: 2.6em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.goal-trend { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.goal-bar-track { height: 6px; background: var(--surface-2); border-radius: 100px; overflow: hidden; margin-bottom: 6px; }
.goal-bar-fill { height: 100%; border-radius: 100px; width: var(--w); }
.goal-interpretation { font-size: 11px; color: var(--text-3); line-height: 1.4; }
.goal-update { font-size: 10px; color: var(--text-3); margin-top: 4px; }

/* Week grid */
.week-grid {
  display: grid;
  grid-template-columns: 140px repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.wg-header {
  background: var(--nav-bg);
  padding: 8px 12px;
  font-size: 11px; font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.wg-header:last-child { border-right: none; }
.wg-day-header {
  background: var(--nav-bg);
  padding: 8px 8px;
  font-size: 11px; font-weight: 600;
  color: #CBD5E1;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.wg-day-header.today { color: var(--nav-accent); }
.wg-row { display: contents; }
.wg-label {
  background: var(--surface-2);
  padding: 9px 12px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex; align-items: center;
}
.wg-cell {
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 7px 6px;
  display: flex; align-items: center; justify-content: center;
}
.wg-cell:last-child { border-right: none; }
.wg-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.wg-done  { background: var(--green-l);  color: var(--green); }
.wg-late  { background: var(--amber-l);  color: var(--amber); }
.wg-miss  { background: var(--red-l);    color: var(--red); }
.wg-conf  { background: var(--blue-l);   color: var(--blue); }
.wg-skip  { background: var(--surface-2); color: var(--text-3); }

/* Trend modules */
.trend-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex: 1;
}
.trend-name {
  font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 4px;
  min-height: 2.6em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.trend-value { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.trend-number { display: inline; font-size: 12px; font-weight: 600; color: var(--text-2); margin-left: 4px; }
.trend-bars { display: flex; gap: 3px; align-items: flex-end; height: 32px; }
.trend-bar { flex: 1; border-radius: 2px 2px 0 0; min-height: 4px; height: var(--h); }
.trend-label { font-size: 10px; color: var(--text-3); margin-top: 4px; }

/* Deviation rows */
.dev-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.dev-row:last-child { border-bottom: none; }
.dev-indicator {
  width: 4px; border-radius: 2px;
  align-self: stretch; flex-shrink: 0; min-height: 40px;
}
.dev-content { flex: 1; min-width: 0; }
.dev-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 3px; }
.dev-trigger { font-size: 12px; color: var(--text-2); margin-bottom: 6px; line-height: 1.4; }
.dev-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dev-action { display: flex; gap: 6px; flex-shrink: 0; }

/* Note stream */
.note-stream { display: flex; flex-direction: column; gap: 0; }

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

/* Sidebar */
/* Header */
.header-stat-value.amber { color: var(--amber); }

/* Section layout */
.section-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.section-meta { font-size: 12px; color: var(--text-3); }
.goal-filters { display: flex; gap: 4px; }
.goal-filter.active { background: var(--surface-2); color: var(--text-1); font-weight: 600; }

/* Goal trends & bars */
.goal-trend.amber { color: var(--amber); }
.goal-trend.green { color: var(--green); }
.goal-trend.red   { color: var(--red); }
.goal-bar-fill.amber { background: var(--amber); }
.goal-bar-fill.green { background: var(--green); }
.goal-bar-fill.red-dim { background: var(--red); opacity: 0.7; }
.goal-bar-fill.blue  { background: var(--blue); }
.goal-bar-fill.neutral { background: var(--border); }

/* Week grid legend */
.wg-legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.wg-legend-item { display: flex; align-items: center; gap: 5px; }
.wg-dot-sm { width: 16px; height: 16px; font-size: 8px; }
.wg-legend-label { font-size: 11px; color: var(--text-3); }

/* Trend values */
.trend-value.amber { color: var(--amber); }
.trend-value.red   { color: var(--red); }
.trend-value.green { color: var(--green); }

/* Trend bar colors */
.trend-bar.green-dim { background: var(--green); opacity: 0.6; }
.trend-bar.green-dimmer { background: var(--green); opacity: 0.5; }
.trend-bar.amber-dim { background: var(--amber); opacity: 0.7; }
.trend-bar.amber { background: var(--amber); }
.trend-bar.red-dim { background: var(--red); opacity: 0.7; }
.trend-bar.red-dimmer { background: var(--red); opacity: 0.8; }
.trend-bar.red { background: var(--red); }
.trend-bar.blue-dim { background: var(--blue); opacity: 0.5; }
.trend-bar.neutral { background: var(--border); }
.trend-bar.neutral-dashed { background: var(--border); border: 1px dashed var(--border-2); }

/* Deviations */
.dev-indicator.amber { background: var(--amber); }
.dev-indicator.red   { background: var(--red); }
.dev-meta-note { font-size: 11px; color: var(--text-3); }

/* Notes */
.note-quick-add { margin-bottom: 16px; }
.note-textarea {
  width: 100%; min-height: 60px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-sans);
  font-size: 13px; color: var(--text-1); line-height: 1.5;
  resize: vertical; margin-bottom: 8px; background: var(--surface);
}
.note-textarea:focus { outline: 2px solid var(--blue); outline-offset: 2px; border-color: var(--blue-m); }
.note-avatar.teal  { background: var(--teal-l); border: 1px solid #99F6E4; color: var(--teal); }
.note-avatar.blue  { background: var(--blue-l); border: 1px solid var(--blue-m); color: var(--blue); }
.note-avatar.amber { background: var(--amber-l); border: 1px solid var(--amber-m); color: var(--amber); }
.tag-blue  { background: var(--blue-l); border-color: var(--blue-m); color: var(--blue); }

/* Right panel */
.risk-meta { font-size: 12px; color: var(--text-3); }

/* Visits */
.visit-timeline { display: flex; flex-direction: column; }
.visit-timeline-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding-bottom: 20px;
  position: relative;
}
.visit-timeline-item:last-child { padding-bottom: 0; }
.visit-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px; top: 16px; bottom: 4px;
  width: 2px;
  background: var(--border);
}
.visit-timeline-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--surface);
  flex-shrink: 0; margin-top: 2px;
  position: relative; z-index: 1;
}
.visit-timeline-item.today .visit-timeline-dot { background: var(--blue); }
.visit-timeline-item.upcoming .visit-timeline-dot { background: var(--amber); }
.visit-timeline-item.past .visit-timeline-dot { background: var(--green); }
.visit-timeline-item.today .visit-name { color: var(--blue); }
.visit-timeline-item.upcoming .visit-name { color: var(--amber); }
.visit-timeline-item.past .visit-name,
.visit-timeline-item.past .visit-meta { color: var(--text-3); }
.visit-timeline-body { flex: 1; min-width: 0; }
.visit-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.visit-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* Flex wrappers */
.goal-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.trend-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.section-title-mb { margin-bottom: 12px; }

.mt-20 { margin-top: 20px; }
.task-row.compact { padding: 8px 0; }
.task-row.compact .task-time { font-size: 11px; }
.task-row.compact .task-name { font-size: 12px; }
.compare-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.compare-row:last-child { border-bottom: none; }
.compare-label { font-size: 12px; color: var(--text-2); }
.compare-delta { font-size: 13px; font-weight: 700; }
.compare-delta.negative { color: var(--red); }
.compare-delta.positive { color: var(--green); }
.compare-delta.neutral { color: var(--text-3); }
.rec-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rec-item:last-child { border-bottom: none; }
.rec-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-l); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.rec-icon .icon { color: var(--blue); }
.rec-text { font-size: 12px; color: var(--text-2); line-height: 1.4; padding-top: 3px; }
.filter-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-3); margin-right: 4px; }
.tag.active { background: var(--text-1); color: #fff; border-color: var(--text-1); }
.dev-row.compact { padding: 10px 0; }
.dev-row.compact .dev-title { font-size: 12px; }
.dev-row.compact .dev-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.mini-timeline { display: flex; flex-direction: column; gap: 12px; }
.mt-item { display: flex; gap: 12px; }
.mt-date { font-size: 11px; font-weight: 600; color: var(--text-3); width: 90px; flex-shrink: 0; }
.mt-text { font-size: 12px; color: var(--text-2); line-height: 1.4; }

.alert-actions { margin-top: 10px; }
.card-blue { background: var(--blue-l); border-color: var(--blue-m); }
.card-body-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-blue-semibold { font-size: 13px; font-weight: 600; color: var(--blue); }
.text-secondary-small { font-size: 12px; color: var(--text-2); }

/* Responsive */
