/* ===========================================================
   WorkPulse — Manager Dashboard styling
   Design idea: a quiet "control room" — slate background,
   monospace for evidence/metrics (it reads like a readout),
   a single signal-amber accent reserved for live state.
   Signature element: each employee is a card with a circular
   progress ring — the ring is either empty (no task yet) or
   reads as an instrument dial of real work, not a generic bar.
   =========================================================== */

:root {
  --bg:        #11151c;
  --panel:     #171c25;
  --panel-2:   #1d232e;
  --panel-3:   #232a36;
  --line:      #2a313d;
  --line-soft: #21262f;
  --text:      #e7eaef;
  --text-dim:  #8b94a3;
  --text-faint:#5c6473;
  --accent:    #f0a73c;
  --accent-dim: rgba(240,167,60,0.15);
  --good:      #5fb98c;
  --good-dim:  rgba(95,185,140,0.15);
  --warn:      #e0a93f;
  --warn-dim:  rgba(224,169,63,0.15);
  --bad:       #d9686b;
  --bad-dim:   rgba(217,104,107,0.15);
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--sans); }

/* ── topbar ──────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 15px;
  display: flex;
  align-items: center;
}
.brand .pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 9px;
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.agent-status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  flex-shrink: 0;
}
.status-dot.on  { background: var(--good); box-shadow: 0 0 0 3px var(--good-dim); }
.status-dot.off { background: var(--bad); }

.meta {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.meta:hover { color: var(--text); }

/* ── layout ──────────────────────────────────────────────────────────── */

main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 36px 28px 90px;
}

h1 {
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.subtitle {
  color: var(--text-dim);
  margin: 0 0 24px;
  font-size: 13px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head .subtitle { margin-bottom: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-dim);
  grid-column: 1 / -1;
}
.empty-state code {
  font-family: var(--mono);
  background: var(--panel-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ── buttons ─────────────────────────────────────────────────────────── */

.btn-primary {
  background: var(--accent);
  color: #1b1408;
  border: none;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s ease, transform 0.06s ease;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.btn-secondary:hover { background: var(--panel-3); }

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.btn-link:hover { opacity: 0.85; }

/* ── employee card grid (the dashboard's signature element) ───────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.emp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.08s ease, background 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.emp-card:hover {
  border-color: var(--text-faint);
  background: var(--panel-2);
}
.emp-card:active { transform: scale(0.99); }

.emp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.emp-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.emp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.emp-identity-text { min-width: 0; }
.emp-name {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emp-team {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* circular progress ring — the card's instrument dial */
.ring-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.ring-wrap svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 4; }
.ring-fill  { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray 0.4s ease; }
.ring-fill.good { stroke: var(--good); }
.ring-fill.warn { stroke: var(--warn); }
.ring-fill.bad  { stroke: var(--bad); }
.ring-fill.none { stroke: var(--line); }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.emp-card-task {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emp-card-task.none {
  color: var(--text-faint);
  font-family: var(--sans);
  font-style: normal;
}

.emp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}
.emp-card-foot .cta {
  color: var(--accent);
  font-weight: 600;
}

.emp-card-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}
.emp-card-badge.live { background: var(--good-dim); color: var(--good); }
.emp-card-badge.idle { background: var(--panel-3); color: var(--text-faint); }

/* ── tag list / status pills (shared with detail page) ─────────────────── */

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.tag.matched { border-color: var(--good); color: var(--good); }
.tag.missing { border-color: var(--bad); color: var(--bad); opacity: 0.85; }

.status-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
}
.status-pill.completed   { background: var(--good-dim); color: var(--good); }
.status-pill.in-progress { background: var(--warn-dim); color: var(--warn); }
.status-pill.not-started { background: var(--bad-dim);  color: var(--bad); }

.score {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
}
.score.good { color: var(--good); }
.score.warn { color: var(--warn); }
.score.bad  { color: var(--bad); }

/* ===========================================================
   Employee detail page
   =========================================================== */

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 13px;
}
.back-link:hover { color: var(--text); }

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.detail-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}
.detail-identity .emp-avatar { width: 52px; height: 52px; font-size: 17px; }

.detail-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-name-row h1 { margin: 0; }
.edit-name-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 13px;
  padding: 2px;
  line-height: 1;
}
.edit-name-btn:hover { color: var(--accent); }

.name-edit-input {
  font-size: 21px;
  font-weight: 600;
  font-family: var(--sans);
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  padding: 2px 8px;
  width: 260px;
}

.detail-task-line {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 3px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.card { padding: 20px; }
.card h2 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 600;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-dim); }

.activity-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: none; }

.timeline { padding: 4px 0; }
.timeline-row {
  display: grid;
  grid-template-columns: 88px 80px 1fr 130px;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  align-items: center;
}
.timeline-row:last-child { border-bottom: none; }
.timeline-time { font-family: var(--mono); color: var(--text-dim); font-size: 12px; }
.timeline-app { font-weight: 600; }
.timeline-detail {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 8px; flex-shrink: 0; }
.dot.relevant { background: var(--good); }
.dot.low_relevance { background: var(--warn); }
.dot.irrelevant { background: var(--bad); }
.dot.unknown { background: var(--text-dim); }

/* ── "assign task" panel shown on the detail page when no task exists ─── */

.assign-panel {
  padding: 28px;
}
.assign-panel .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 480px;
}

label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 14px 0 6px;
}
label:first-of-type { margin-top: 0; }

input, textarea, select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 11px;
  resize: vertical;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--bad); font-size: 12px; margin-top: 10px; min-height: 14px; }

.assign-result-stats { max-width: 480px; }

/* ===========================================================
   Modals — add employee (resume upload) + assign task
   =========================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.65);
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 24px 26px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.modal-header h2 { font-size: 16px; margin: 0; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* resume drop zone */
.drop-zone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
  margin-top: 14px;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--panel-2);
}
.drop-zone .drop-icon { font-size: 22px; margin-bottom: 8px; display: block; }
.drop-zone .drop-text { font-size: 13px; color: var(--text); }
.drop-zone .drop-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.drop-zone input[type="file"] { display: none; }

.resume-filename {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 8px 11px;
}
.resume-filename button {
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 13px;
}

.extracted-name-row {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 16px;
}
.extracted-name-row .extracted-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #1b1408;
  display: inline-block;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================================================
   Additions — refresh timer badge, task header bar with
   edit/delete, and the grouped "attention needed" section
   that replaces the old raw-dumped Missing / Flagged lists.
   =========================================================== */

.refresh-badge {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.card-refresh-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 7px;
}

.task-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 6px;
}
.task-header-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}
.task-header-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.task-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-secondary.danger {
  color: var(--bad);
  border-color: rgba(217,104,107,0.35);
}
.btn-secondary.danger:hover { background: var(--bad-dim); }
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.task-edit-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0 4px 16px;
}

/* ── grouped attention section (replaces raw dumped lists) ────────────── */

.attn-row {
  margin-bottom: 18px;
}
.attn-row:last-child { margin-bottom: 0; }
.attn-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.attn-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.attn-count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--text-dim);
}
.attn-count.bad { color: var(--bad); border-color: rgba(217,104,107,0.3); }

.flagged-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.flagged-summary-row:last-child { border-bottom: none; }
.flagged-summary-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.flagged-summary-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.flagged-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.flagged-detail-row:last-child { border-bottom: none; }
.flagged-detail-label { min-width: 0; word-break: break-word; padding-right: 14px; }
.flagged-detail-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  text-align: right;
}

.timeline-app.file-change {
  color: var(--accent);
}

/* Real spacer between adjacent action buttons — guards against any
   text-extraction or accessibility tooling collapsing flex `gap` into
   zero visible whitespace between button labels. */
.action-gap {
  display: inline-block;
  width: 8px;
}

.activity-name {
  color: var(--text);
}

/* Stronger guarantee that activity-row's two children never visually
   touch, independent of justify-content rendering. */
.activity-row {
  gap: 12px;
}

/* ===========================================================
   Source banner — tells the truth about whether a result came
   from a real Qwen3 call or an offline fallback guess. Never
   let the two render identically.
   =========================================================== */

.source-banner {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
}
.source-banner.ok,
.source-banner.warn {
  display: block;
}
.source-banner.ok {
  background: var(--good-dim);
  color: var(--good);
  border: 1px solid rgba(95,185,140,0.3);
}
.source-banner.warn {
  background: var(--warn-dim);
  color: var(--warn);
  border: 1px solid rgba(224,169,63,0.35);
}
.source-banner-detail {
  font-weight: 400;
  font-size: 12px;
  margin-top: 6px;
  color: var(--text-dim);
}

/* ===========================================================
   Connect employee — distinct yellow accent so this primary
   action (pairing) reads as visually different from the
   amber "live state" accent used elsewhere.
   =========================================================== */

.btn-connect {
  background: #f5d33c;
  color: #2a2204;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s ease, transform 0.06s ease;
}
.btn-connect:hover { filter: brightness(1.08); }
.btn-connect:active { transform: scale(0.98); }

/* ===========================================================
   Employee setup page — pairing credential display, waiting state
   =========================================================== */

.pairing-credential-box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.pairing-credential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.pairing-credential-row:not(:last-child) {
  border-bottom: 1px solid var(--line-soft);
}
.pairing-credential-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pairing-credential-value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.waiting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
}
/* ===========================================================
   Work-intelligence layer — status badges, deliberately NOT a
   simple green/red-at-every-threshold model. "unknown" and
   "watch" get their own neutral, non-alarming treatment.
   =========================================================== */
.status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}
.status-badge.on_track  { background: var(--good-dim); color: var(--good); }
.status-badge.completed { background: var(--good-dim); color: var(--good); }
.status-badge.watch     { background: var(--warn-dim); color: var(--warn); }
.status-badge.at_risk   { background: var(--bad-dim);  color: var(--bad); }
.status-badge.blocked   { background: var(--bad-dim);  color: var(--bad); }
.status-badge.unknown   { background: rgba(139,148,163,0.15); color: var(--text-dim); }

.observation-block {
  display: grid;
  grid-template-columns: 130px 90px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.observation-block:last-child { border-bottom: none; }
.observation-time { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.observation-duration { color: var(--text-dim); font-size: 12px; }
.observation-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.observation-label .dot { flex-shrink: 0; }
.observation-count { color: var(--text-dim); font-size: 11.5px; }

/* ===========================================================
   Recorded-activity panel (activity_panel.js) — shared by the manager
   employee page, the team overview and the employee's own dashboard.
   =========================================================== */
.act-root { margin-top: 8px; }
.emp-team-activity-chart { position: relative; height: 280px; max-width: 100%; margin: 4px 0 18px; }
.emp-team-activity-chart canvas { display: block; }
.act-root.act-loading { opacity: .6; transition: opacity .15s; }
.act-controls { display:flex; justify-content:space-between; align-items:center; margin: 4px 0 14px; flex-wrap:wrap; gap:8px; }
.act-range button { background: var(--panel-2); color: var(--text-dim); border: 1px solid var(--line); padding: 6px 12px; cursor: pointer; font-size: 12px; }
.act-range button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.act-range button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.act-range button.on { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.act-meta, .act-foot { color: var(--text-faint); font-size: 12px; }
.act-kpis { display:grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.act-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.act-kpi-label { color: var(--text-dim); font-size: 12px; }
.act-kpi-value { font-family: var(--mono); font-size: 24px; margin: 4px 0 2px; }
.act-kpi-sub { color: var(--text-faint); font-size: 11.5px; }
.act-kpi.good .act-kpi-value { color: var(--good); } .act-kpi.warn .act-kpi-value { color: var(--warn); }
.act-kpi.bad .act-kpi-value { color: var(--bad); } .act-kpi.dim .act-kpi-value { color: var(--text-dim); }
.act-banner { background: var(--warn-dim); border: 1px solid var(--warn); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.act-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.act-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.act-grid .act-card { margin-bottom: 0; }
.act-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.act-canvas { position: relative; height: 240px; } .act-canvas.short { height: 180px; }
.act-strip { position: relative; height: 34px; background: var(--panel-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--line-soft); }
.act-seg { position: absolute; top: 0; bottom: 0; opacity: .9; }
.act-strip-axis { display:flex; justify-content:space-between; color: var(--text-faint); font-size: 11px; margin-top: 4px; }
.act-mark { position: absolute; top: 0; width: 2px; height: 100%; }
.mark-commit { background: #ffffff; } .mark-file { background: rgba(255,255,255,.45); height: 40%; top: 60%; }
.seg-development { background: #5fb98c; } .seg-browser { background: #5b9bd5; } .seg-communication { background: #b58bd9; }
.seg-documents { background: #e0a93f; } .seg-system { background: #7b8494; } .seg-unclassified { background: #a3917b; }
.seg-unknown { background: repeating-linear-gradient(45deg, #2a313d, #2a313d 4px, #1d232e 4px, #1d232e 8px); }
.act-legend { display:flex; flex-wrap:wrap; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--text-dim); }
.act-legend i { display:inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.mark-commit-dot { background:#fff; border-radius: 50% !important; } .mark-file-dot { background: rgba(255,255,255,.45); }
.act-dq { display:grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.act-dq div { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.act-dq b { display:block; font-family: var(--mono); font-size: 18px; } .act-dq span { color: var(--text-dim); font-size: 11.5px; }
.act-scroll { overflow-x: auto; } .act-scroll.tall { max-height: 420px; overflow-y: auto; }
.act-table { width:100%; border-collapse: collapse; font-size: 12.5px; }
.act-table th { text-align:left; color: var(--text-dim); font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.act-table td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.act-table code { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.act-row:hover { background: var(--panel-2); }
.act-pill { display:inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; background: var(--panel-3); color: var(--text-dim); }
.act-pill.good, .act-pill.closed { background: var(--good-dim); color: var(--good); }
.act-pill.warn, .act-pill.interrupted { background: var(--warn-dim); color: var(--warn); }
.act-pill.bad { background: var(--bad-dim); color: var(--bad); } .act-pill.open { background: var(--accent-dim); color: var(--accent); }
.act-empty { color: var(--text-dim); padding: 22px; text-align:center; }
.act-note { color: var(--text-faint); font-size: 12px; margin-top: 6px; }
.act-tag { font-size: 10.5px; font-weight: 500; color: var(--text-faint); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-left: 8px; }
.act-btn { background: var(--accent); color: #11151c; border: 0; border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; font-weight: 600; margin-top: 8px; }
.act-link { color: var(--accent); font-size: 11.5px; margin-left: 8px; }
.act-details { margin-top: 12px; } .act-details summary { cursor: pointer; color: var(--text-dim); font-size: 12.5px; }
.act-defs { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
.act-defs p { margin: 2px 0; font-size: 12px; color: var(--text-dim); } .act-defs .lim { color: var(--text-faint); }
.act-list { margin: 8px 0 0 18px; padding: 0; font-size: 12px; color: var(--text-dim); }
.act-device { font-size: 13px; padding: 4px 0; }
#actCorrectionNote { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; font-family: var(--sans); }

/* ── Task relevance panel ─────────────────────────────────────────────── */
.tk-root { margin-top: 20px; }
.tk-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tk-tabs button { background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; cursor: pointer; }
.tk-tabs button.on { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }
.tk-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.tk-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.tk-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.tk-title { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.tk-desc { color: var(--text-dim); font-size: 13.5px; line-height: 1.5; max-width: 760px; margin: 0; }
.tk-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-dim); margin: 2px 4px 2px 0; }
.tk-chip.ok { border-color: #2f8f67; color: #5fd3a0; background: rgba(62,207,142,.10); }
.tk-chip.miss { border-color: #a4443f; color: #ef8a85; background: rgba(239,91,91,.08); }
.tk-chip.prio { border-color: var(--accent); color: var(--accent); }
.tk-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.tk-meta div { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.tk-meta b { display: block; font-size: 16px; } .tk-meta span { color: var(--text-faint); font-size: 11.5px; }
.tk-bar { height: 8px; background: var(--panel-3); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.tk-bar i { display: block; height: 100%; background: var(--accent); }
.tk-split { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 24px; align-items: center; }
@media (max-width: 760px) { .tk-split { grid-template-columns: 1fr; } }
.tk-pie { position: relative; height: 260px; }
.tk-legend { display: flex; flex-direction: column; gap: 8px; }
.tk-lrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); cursor: pointer; text-align: left; color: var(--text); font: inherit; width: 100%; }
.tk-lrow:hover { border-color: var(--accent); }
.tk-lrow[disabled] { opacity: .5; cursor: default; }
.tk-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.tk-lname { flex: 1; font-size: 13.5px; } .tk-lname small { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }
.tk-lval { text-align: right; font-size: 13px; } .tk-lval b { font-size: 16px; display: block; }
.tk-hint { color: var(--text-faint); font-size: 12px; margin: 10px 0 0; }
.tk-insights { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }
.tk-canvas { position: relative; height: 220px; }
.tk-actrow { display: grid; grid-template-columns: 130px 1fr 110px; gap: 10px; align-items: center; margin: 9px 0; font-size: 13px; }
.tk-actrow .tk-bar { margin: 0; height: 14px; }
.tk-actrow .none { color: #ef8a85; font-size: 12px; }
.tk-notice { border-left: 4px solid var(--warn); }
.tk-notice pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; font-size: 12px; overflow-x: auto; margin: 10px 0 0; }
.tk-foot { color: var(--text-faint); font-size: 12px; margin-top: 8px; }

/* popup */
.tk-overlay { position: fixed; inset: 0; background: rgba(5,8,12,.66); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tk-modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(860px, 100%); max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.tk-mhead { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.tk-mhead h3 { margin: 0; font-size: 17px; } .tk-mhead p { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }
.tk-x { margin-left: auto; background: none; border: 0; color: var(--text-dim); font-size: 22px; line-height: 1; cursor: pointer; }
.tk-mbody { padding: 16px 22px 22px; overflow-y: auto; }
.tk-tool { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--panel-2); }
.tk-toolhead { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.tk-toolhead span { color: var(--text-dim); font-weight: 400; font-size: 12.5px; }
.tk-why { padding: 0 14px 8px; color: var(--text-faint); font-size: 12px; }
.tk-items { list-style: none; margin: 0; padding: 0 14px 10px; }
.tk-items li { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.tk-items li .t { overflow-wrap: anywhere; } .tk-items li .d { color: var(--text-dim); white-space: nowrap; text-align: right; }
.tk-sec { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
