/* ITS CRM record cards: deal, task, project, contact, company.
   All of them are built from .tc-card sections; this layer gives those sections one look,
   matching the home dashboard and page system (home.css, portal.css). Loaded last. */

/* Section surfaces: one radius, border and shadow everywhere (contact/company cards were 12px) */
:root[data-theme] :is(#modal-root, #page) .tc-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--page-shadow, 0 1px 2px var(--shadow-color), 0 4px 16px var(--shadow-color));
}

/* Section titles: same size and weight as dashboard card titles */
:root[data-theme] :is(#modal-root, #page) .tc-card h3 {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ink);
}

/* Counters next to section titles ("Файлы 0", "Задачи 2 / 2", "Связанные сделки 1", checklist) */
:root[data-theme] :is(#modal-root, #page) .tc-card h3 > span:not(.sr-only),
:root[data-theme] :is(#modal-root, #page) .tc-card .tc-check-counter {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--blue-text);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* Sub-group titles inside a section (project team: Руководитель, Соисполнители…) */
:root[data-theme] :is(#modal-root, #page) .tc-card h4 {
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--secondary);
}
:root[data-theme] :is(#modal-root, #page) .tc-card h4 > span { color: var(--muted); font-weight: 500; }

/* Field labels: quieter than values, so values read first */
:root[data-theme] :is(#modal-root, #page) .tc-card .tc-label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
}

/* Collapsible groups ("Дополнительные параметры", "Цель и условия проекта", "Управление проектом") */
:root[data-theme] :is(#modal-root, #page) .tc-card details > summary {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--secondary);
}
:root[data-theme] :is(#modal-root, #page) .tc-card details > summary:hover { color: var(--ink); }

/* Project page tabs: same quiet bar as other section tabs */
:root[data-theme] #page .project-tabs {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--page-shadow, none);
}
