/* NeuralDesk — Company page styles */

/* ══════════════════════════════════════
   Company Header — Toolbar
   ══════════════════════════════════════ */

.co-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 16px;
}

.co-id {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  margin: -4px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.co-id:hover { background: var(--color-surface-alt); }

.co-id__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.co-id__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.co-id__edit {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-tertiary);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.co-id__edit:hover { background: var(--color-surface-alt); color: var(--color-text-secondary); }
.co-id__edit svg { width: 14px; height: 14px; }


.co-spacer { flex: 1; }

.co-days {
  display: flex;
  gap: 1px;
  background: var(--color-surface-alt);
  border-radius: 8px;
  padding: 2px;
}

.co-day {
  width: 28px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  position: relative;
  line-height: 1;
}

.co-day:hover { color: var(--color-text-secondary); background: var(--color-surface); }

.co-day--active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-weight: 600;
}

.co-day--active:hover { background: var(--color-primary-hover); color: var(--color-text-inverse); }

.co-day--today::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-primary);
}

.co-day--active.co-day--today::after { background: var(--color-text-inverse); }



.co-view {
  display: flex;
  gap: 1px;
  background: var(--color-surface-alt);
  border-radius: 6px;
  padding: 2px;
}

.co-view__btn {
  height: 24px;
  padding: 0 10px;
  border: none;
  border-radius: 5px;
  background: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  white-space: nowrap;
}

.co-view__btn:hover { color: var(--color-text-secondary); }

.co-view__btn--active {
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.co-view__btn--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}


/* ══════════════════════════════════════
   TIMELINE — Lane-based monitoring
   ══════════════════════════════════════ */

.agent-sections {
  display: flex;
  flex-direction: column;
}

/* Agent Lane */
.tl-lane {
  position: relative;
  padding: 16px 0;
  animation: laneIn 0.4s ease both;
}

.tl-lane:not(:last-child) {
  border-bottom: 1px solid var(--color-border-light);
}

.tl-lane:nth-child(1) { animation-delay: 0.05s; }
.tl-lane:nth-child(2) { animation-delay: 0.12s; }
.tl-lane:nth-child(3) { animation-delay: 0.19s; }

@keyframes laneIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tl-lane__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.tl-lane__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.tl-lane__name { font-size: 13px; font-weight: 600; line-height: 1; }

.tl-lane__warn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-error, #c45a3a);
  background: rgba(196, 90, 58, 0.08);
  border: 1px solid rgba(196, 90, 58, 0.25);
  border-radius: var(--radius-full);
  padding: 2px 8px 2px 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  animation: warnPulse 2s ease-in-out infinite;
  /* reset button styles */
  font-family: inherit;
}
.tl-lane__warn:hover {
  background: rgba(196, 90, 58, 0.15);
  border-color: rgba(196, 90, 58, 0.4);
}
@keyframes warnPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.tl-lane__badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-tertiary);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1;
}

.tl-lane__task-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tl-lane__task-count svg { flex-shrink: 0; }

/* Track (24h bar) */
.tl-track {
  position: relative;
  height: 36px;
  background: var(--color-surface-alt);
  border-radius: 8px;
  overflow: visible;
}

.tl-track__grid {
  position: absolute;
  inset: -8px 0;
  display: flex;
  padding: 8px 0;
  border-radius: 8px;
  overflow: visible;
}

.tl-track__hour-cell {
  flex: 1;
  border-right: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: transparent;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.tl-track__hour-cell:last-child { border-right: none; }

.tl-track__hour-cell--completed {
  background: rgba(90, 154, 107, 0.15);
  color: var(--color-success);
}

.tl-track__hour-cell--active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  position: relative;
  z-index: 11;
  animation: cellGlow 2s ease-in-out infinite;
}

@keyframes cellGlow {
  0% { box-shadow: 0 0 0 0 rgba(201, 86, 43, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(201, 86, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 86, 43, 0); }
}

.tl-track--hide-now .tl-now-marker__line,
.tl-track--hide-now .tl-now-marker__dot {
  display: none;
}

.tl-track__hour-cell--upcoming {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tl-track__hour-cell--pending {
  background: rgba(173, 168, 159, 0.1);
  color: var(--color-text-tertiary);
}

.tl-track__hour-cell--idle {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.tl-track__past {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(201, 86, 43, 0.04);
  border-radius: 8px 0 0 8px;
  pointer-events: none;
  z-index: 1;
}

/* Now marker */
.tl-now-marker {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 2px;
  z-index: 10;
  pointer-events: none;
}

.tl-now-marker__line {
  position: absolute;
  inset: 0;
  background: var(--color-primary);
  border-radius: 1px;
}

.tl-now-marker__dot {
  position: absolute;
  top: -3px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-surface);
}

.tl-now-marker__time {
  position: absolute;
  bottom: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  background: var(--color-surface);
  padding: 1px 4px;
  border-radius: 4px;
}

/* Hour labels */
.tl-hours {
  position: relative;
  height: 14px;
  margin-top: 4px;
}

.tl-hours__label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

/* Upcoming pill */
.tl-upcoming {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 12px;
  animation: upcomingIn 0.5s ease both;
  animation-delay: 0.3s;
}

@keyframes upcomingIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.tl-upcoming__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
  animation: upcomingDotPulse 1.5s ease-in-out infinite;
}

@keyframes upcomingDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.tl-upcoming__label { font-weight: 500; color: var(--color-text-secondary); }
.tl-upcoming__name { font-weight: 600; color: var(--color-text); }
.tl-upcoming__time { font-weight: 600; color: var(--color-primary); font-variant-numeric: tabular-nums; }

/* Hire lane (ghost placeholder) */
.tl-lane--hire {
  text-decoration: none;
  color: inherit;
  opacity: 0.5;
  transition: opacity 0.15s;
  cursor: pointer;
}

.tl-lane--hire:hover { opacity: 0.8; }

.tl-lane__avatar--ghost {
  background: var(--color-surface-alt) !important;
  color: var(--color-text-tertiary) !important;
  border: 1px dashed var(--color-border);
}

.tl-lane__avatar--ghost svg { width: 12px; height: 12px; }

.tl-track--ghost {
  border: 1px dashed var(--color-border);
  background: transparent;
}

/* ══════════════════════════════════════
   Agents list view
   ══════════════════════════════════════ */

.agents-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.agent-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.12s;
  animation: jobRowIn 0.3s ease both;
  text-decoration: none;
  color: inherit;
}

.agent-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.agent-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.agent-card__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.agent-card__role { font-size: 10px; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }

.agent-card__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.agent-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
}
.agent-card__stat--online { color: #34a853; }
.agent-card__stat svg { flex-shrink: 0; }

/* Hire ghost card */
.agent-card--hire {
  border-style: dashed;
  opacity: 0.5;
  transition: opacity 0.15s;
  cursor: pointer;
  justify-content: center;
  min-height: 100px;
}

.agent-card--hire:hover { opacity: 0.8; }

.agent-card__avatar--ghost {
  background: var(--color-surface-alt);
  color: var(--color-text-tertiary);
  border: 1px dashed var(--color-border);
}

.agent-card__avatar--ghost svg { width: 16px; height: 16px; }

/* ========================================
   Schedule view: scenarios | jobs split
   — No section titles. Thin vertical rule as separator.
   — Both columns use flat-row rhythm so they feel unified.
   ======================================== */

.co-schedule {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 0;
  align-items: start;
  padding-top: 4px;
}

.co-schedule__col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.co-schedule__col--scenarios {
  padding-right: 28px;
  border-right: 1px solid var(--color-border);
}

.co-schedule__col--jobs {
  padding-left: 28px;
}

/* Column caption — tiny caps, terracotta accent tick.
   Same pattern as .palette__title in the scenario editor for consistency. */
.co-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  position: relative;
  padding: 0 0 14px 12px;
  margin-bottom: 6px;
}

.co-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 1px;
  background: var(--color-primary);
}

/* Drop the default top margin of the first jobs separator inside the split
   layout — the column already has its own caption above */
.co-schedule__col--jobs > .jobs-separator:first-of-type {
  margin-top: 0;
}

/* ========================================
   Jobs list view (flat rows)
   ======================================== */

.jobs-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jobs-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
}

.jobs-separator__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

.jobs-separator__line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* Job row */
.job-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  overflow: hidden;
  animation: jobRowIn 0.3s ease both;
}

@keyframes jobRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.job-row:hover { background: var(--color-surface-alt); }

/* Main info */
.job-row__main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  min-width: 0;
}

.job-row__type-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.job-row--periodic .job-row__type-icon { background: var(--color-primary-light); color: var(--color-primary); }
.job-row--once .job-row__type-icon { background: rgba(196, 151, 42, 0.08); color: var(--color-warning, #C4972A); }
.job-row__type-icon svg { width: 16px; height: 16px; }

.job-row__info { min-width: 0; }

.job-row__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-row__schedule {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Day dots */
.job-row__days { display: flex; gap: 3px; }

.job-row__day {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border);
  line-height: 1;
}

.job-row__day--active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.job-row__time {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.job-row__date-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-warning, #C4972A);
  background: rgba(196, 151, 42, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Agent cell */
.job-row__agent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  flex-shrink: 0;
  white-space: nowrap;
}


.job-row__agent-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.job-row__agent-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Toggle */
.job-row__toggle {
  padding: 4px 8px 4px 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Empty/create row */
.job-row--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-tertiary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.job-row--empty:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.job-row--empty svg { width: 14px; height: 14px; }

@media (max-width: 768px) {
  .tl-track { height: 32px; }
  .tl-track__hour-cell { font-size: 0; }
  .tl-lane__header { gap: 8px; }
  .tl-lane__badge { display: none; }
  .tl-upcoming { font-size: 11px; padding: 4px 10px; gap: 6px; }
  .tl-upcoming__label { display: none; }
  .tl-hours__label { font-size: 8px; }
  .tl-lane { padding: 12px 0; }
  .co-header { flex-wrap: wrap; gap: 8px; }
  .co-spacer { display: none; }
  .co-days { order: 10; width: 100%; justify-content: space-between; }
  .co-day { flex: 1; min-width: 0; }
  .co-schedule { grid-template-columns: 1fr; gap: 0; }
  .co-schedule__col--scenarios {
    padding-right: 0;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .co-schedule__col--jobs { padding-left: 0; }
  /* Touch: action buttons always visible, no hover state */
  .scenario-card__actions { opacity: 1; }
}

/* ══════════════════════════════════════
   Agent Detail View
   ══════════════════════════════════════ */

.ag-detail {
  animation: laneIn 0.25s ease both;
}

.ag-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}

.ag-detail__back:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ag-detail__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: 0;
}

.ag-detail__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.ag-detail__avatar--online::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34a853;
  border: 2.5px solid var(--color-surface-alt);
}

.ag-detail__info {
  flex: 1;
  min-width: 0;
}

.ag-detail__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.ag-detail__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.ag-detail__role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--color-text-tertiary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.ag-detail__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-tertiary);
}

.ag-detail__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ccc;
}

.ag-detail__status-dot--online {
  background: #34a853;
  box-shadow: 0 0 6px rgba(52, 168, 83, 0.4);
}

/* Agent Detail Tabs */

.ag-detail__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border-light);
  margin: 20px 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ag-detail__tabs::-webkit-scrollbar { display: none; }

.ag-detail__tab {
  padding: 10px 16px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s;
}

.ag-detail__tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: transparent;
  border-radius: 1px;
  transition: background 0.15s;
}

.ag-detail__tab--active {
  color: var(--color-primary);
  font-weight: 600;
}

.ag-detail__tab--active::after {
  background: var(--color-primary);
}

.ag-detail__tab:hover:not(.ag-detail__tab--active) {
  color: var(--color-text-secondary);
}

.ag-detail__tab--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ag-detail__tab--disabled:hover { color: var(--color-text-tertiary); }

.ag-detail__panel {
  padding-top: 20px;
  animation: laneIn 0.2s ease both;
}

/* ── Personality Traits ── */

@keyframes traitFill {
  from { width: 0; }
}

.ag-trait {
  display: grid;
  grid-template-columns: 100px 1fr 32px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.ag-trait__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.ag-trait__bar {
  height: 6px;
  background: var(--color-border-light);
  border-radius: 3px;
  overflow: hidden;
}

.ag-trait__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--color-primary);
  animation: traitFill 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ag-trait__value {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ag-section {
  margin-bottom: 20px;
}

/* Personality creation prompt */
.ag-create-personality {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
}
.ag-create-personality__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  margin-bottom: 16px;
}
.ag-create-personality__icon svg { width: 22px; height: 22px; }
.ag-create-personality__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}
.ag-create-personality__desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 300px;
  margin-inline: auto;
}
.ag-create-personality__input {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 16px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  resize: vertical;
  outline: none;
}
.ag-create-personality__input:focus {
  border-color: var(--color-primary);
}

.ag-section__title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

/* Expertise Tags */

.ag-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ag-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 600;
}

/* Message Style Radio */

.ag-style-group {
  display: flex;
  gap: 8px;
}

.ag-style-option {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}

.ag-style-option--active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Personality Actions */

.ag-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.ag-actions .btn {
  font-size: 12px;
}

/* ── Chats & Groups ── */

.ag-chat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.ag-chat-row:last-of-type {
  border-bottom: none;
}

.ag-chat-row__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.ag-chat-row__info {
  flex: 1;
  min-width: 0;
}

.ag-chat-row__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-chat-row__count {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 1px;
}

.ag-chat-row__remove {
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
}

.ag-chat-row__remove:hover {
  color: #d93025;
  background: rgba(217, 48, 37, 0.08);
}

/* ── Knowledge Base / Vault ── */

.ag-vault {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ag-vault__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border-light);
}

.ag-vault__search {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.ag-vault__search:focus { border-color: var(--color-primary); }

.ag-vault__content {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 200px;
}

.ag-vault__tree {
  border-right: 1px solid var(--color-border-light);
  padding: 8px 0;
  overflow-y: auto;
  max-height: 300px;
}

.ag-vault__file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.1s;
}

.ag-vault__file:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.ag-vault__file--active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.ag-vault__file--auto::after {
  content: 'AI';
  margin-left: auto;
  font-size: 8px;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.6;
}

.ag-vault__preview {
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  overflow-y: auto;
  max-height: 300px;
}

.ag-vault__preview h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
}

.ag-vault__preview p {
  margin: 0 0 8px;
}

/* ── Action History ── */

.ag-log__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.ag-log__item:last-child { border-bottom: none; }

.ag-log__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-tertiary);
}

.ag-log__icon--message { color: var(--color-primary); background: var(--color-primary-light); border-color: transparent; }
.ag-log__icon--task { color: #34a853; background: rgba(52,168,83,0.1); border-color: transparent; }
.ag-log__icon--join { color: #4285f4; background: rgba(66,133,244,0.1); border-color: transparent; }
.ag-log__icon--error { color: #d93025; background: rgba(217,48,37,0.08); border-color: transparent; }

.ag-log__body {
  flex: 1;
  min-width: 0;
}

.ag-log__text {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.4;
}

.ag-log__time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

/* ── Agent Settings ── */

.ag-settings__field {
  margin-bottom: 16px;
}

.ag-settings__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  display: block;
}

.ag-settings__select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--color-text);
  outline: none;
}

.ag-settings__select:focus { border-color: var(--color-primary); }

.ag-settings__textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  color: var(--color-text);
  resize: vertical;
  outline: none;
  line-height: 1.5;
  box-sizing: border-box;
}

.ag-settings__textarea:focus { border-color: var(--color-primary); }

.ag-settings__toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.ag-settings__toggle-info {
  flex: 1;
}

.ag-settings__toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

.ag-settings__toggle-desc {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

/* ── Agent Detail Mobile ── */

@media (max-width: 600px) {
  .ag-detail__header { padding: 12px; }
  .ag-detail__avatar { width: 44px; height: 44px; font-size: 18px; }
  .ag-detail__avatar--online::after { width: 10px; height: 10px; border-width: 2px; }
  .ag-detail__name { font-size: 16px; }
  .ag-detail__tab { padding: 8px 12px; font-size: 12px; }
  .ag-trait { grid-template-columns: 80px 1fr 28px; gap: 8px; }
  .ag-vault__content { grid-template-columns: 1fr; }
  .ag-vault__tree { border-right: none; border-bottom: 1px solid var(--color-border-light); max-height: 150px; }
  .ag-style-group { flex-wrap: wrap; }
}
