/* ai-os-admin-design · agentcard/card.css — карточка агента на вкладках
   (19.09.2026, макет владельца).

   Шапка над вкладками, пять панелей: обзор, инструкции, навыки, арт,
   настройки. Вкладки — тот же .seg, что во «Встречах». Цвет только
   токенами из tokens.css. Без JS панели видны все подряд — tabs.js
   ставит на .agent-tabs класс js и прячет лишние. */

.tnum { font-variant-numeric: tabular-nums; }

/* ── Шапка: «последний запуск / следующий» ───────────────────────── */
.agent-last {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  margin-top: 12px; font-size: var(--fs-xs); align-items: center;
}
.al-k { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--fg-label); font-weight: 600; }
.al-v { color: var(--fg-soft); display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.al-v .status-pill { padding: 1px 7px; }

/* ── Вкладки ─────────────────────────────────────────────────────── */
.agent-tabs { display: flex; align-items: center; gap: 14px; margin: 18px 0 16px; flex-wrap: wrap; }
.agent-tabs .seg { max-width: 100%; overflow-x: auto; flex: none; }
.seg .tab {
  position: relative; gap: 6px; padding: 8px 14px; min-height: 34px;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
/* зона нажатия до 40px по вертикали — визуально кнопка ниже */
.seg .tab::before { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.seg .tab:hover:not(.active) { background: var(--paper-mute); color: var(--fg); }
.seg .tab:focus-visible { outline: 2px solid var(--info); outline-offset: -2px; }
.seg .tab:active { transform: scale(0.98); }
.tab-n {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; line-height: 1.4;
  padding: 1px 6px; border-radius: var(--radius-tag);
  background: var(--tag-bg); color: var(--fg-muted); font-variant-numeric: tabular-nums;
}
.seg .tab.active .tab-n { background: rgba(255,255,255,.18); color: var(--fg-on-ink); }

/* ── Панели ──────────────────────────────────────────────────────── */
/* Без JS все панели подряд — как раньше одной простынёй. */
.agent-tabs:not(.js) ~ .tab-pane { display: block !important; }
.tab-pane[hidden] { display: none; }
.tab-pane .block-head:first-child { margin-top: 0; }
/* Блоки входят лесенкой; выход без анимации — панель просто прячется. */
.tab-pane > * { animation: pane-in 220ms var(--ease-out) both; }
.tab-pane > :nth-child(2) { animation-delay: 40ms; }
.tab-pane > :nth-child(3) { animation-delay: 80ms; }
.tab-pane > :nth-child(4) { animation-delay: 120ms; }
.tab-pane > :nth-child(5) { animation-delay: 160ms; }
.tab-pane > :nth-child(6) { animation-delay: 200ms; }
.tab-pane > :nth-child(n+7) { animation-delay: 240ms; }
@keyframes pane-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── Итог: одна карточка, пять клеток через тонкие делители ───────── */
.stat-card { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px 13px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border-faint); }
.st-k { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--fg-label); font-weight: 600; }
.st-v { font-size: 22px; font-weight: 600; line-height: 1.15; color: var(--fg); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.st-v.is-err { color: var(--err); }
.st-v.is-warn { color: var(--warn); }
.st-s { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* ── Запуски: ошибка под пилюлей ─────────────────────────────────── */
.tbl.runs .hint { margin: 4px 0 0; font-size: var(--fs-xs); }
.reply summary { cursor: pointer; }

/* ── Кнопки чуть сжимаются при нажатии ───────────────────────────── */
.btn { transition-property: background, color, border-color, transform;
       transition-duration: var(--dur-base), var(--dur-base), var(--dur-base), var(--dur-fast); }
.btn:active:not(:disabled) { transform: scale(0.96); }

/* ── Реестр: подписи в полях ─────────────────────────────────────── */
.reg-form { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr auto; gap: 12px; align-items: end; }
.reg-form .field { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 7px 12px; }
.reg-form .fl { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--fg-label); font-weight: 600; }
.reg-form .btn { height: 38px; align-self: end; }

/* ── Увольнение — карточка с красной кромкой слева ───────────────── */
.danger-zone { display: flex; align-items: center; gap: 16px; border-left: 2px solid var(--err); }
.dz-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dz-title { font-size: 13.5px; font-weight: 500; color: var(--fg); }
.dz-sub { font-size: var(--fs-xs); color: var(--fg-muted); line-height: 1.5; text-wrap: pretty; }

@media (max-width: 900px) {
  .stat-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: none; border-top: 1px solid var(--border-faint); }
  .stat:nth-child(5) { border-top: 1px solid var(--border-faint); }
  .reg-form { grid-template-columns: 1fr; }
  .agent-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .agent-last { grid-template-columns: 1fr; gap: 2px; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-pane > * { animation: none; }
  .btn:active:not(:disabled), .seg .tab:active { transform: none; }
}

/* Заглушка портрета: путь к idle.png длиннее клетки — переносится, не вылезает. */
.agent-portrait.empty .ap-note { overflow-wrap: anywhere; max-width: 100%; }

/* Черновик навыка от Claude (срез 5 «Идей и правок»). Плашки — свой класс,
   не .row-note: тот зарезервирован за флешем ?skill= и ?art=. */
.skilldraft { margin-bottom: 10px; }
.skilldraft [hidden] { display: none; }
.skilldraft-input { min-height: 0; }
.skilldraft-status { font-size: 12px; color: var(--fg-muted); }
.skilldraft-status.err { color: var(--err); }
.skilldraft-status.busy::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: skilldraft-spin .8s linear infinite;
}
@keyframes skilldraft-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .skilldraft-status.busy::before { animation: none; } }
.skilldraft-note { margin-top: 6px; padding: 6px 9px; border-left: 2px solid var(--warn);
  background: var(--warn-bg); font-size: 12px; }
