/* agents/agents.css  -  the AGENTS tab: the agent sub-tabs, the agent's health line, the cards with the
   approved 1-3-1 face, the Cost and Gets drawer, the buttons. Phone rules at the bottom. */

.agent-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.agent-tabs button { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.agent-tabs button:hover { color: var(--text); background: var(--panel-2); }
.agent-tabs button.on { color: var(--accent); background: var(--accent-dim); }
.agent-tabs button.add { border-color: var(--line); text-transform: none; letter-spacing: 0; }
.agent-tabs .count { font-size: 10px; background: var(--accent); color: var(--btnfg, #fff); border-radius: 8px; padding: 1px 6px; }
.agent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.agent-head h2 { margin: 0 0 4px; }

.card-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.card-tabs button { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.card-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.cc-count { font-weight: 400; opacity: .8; }

.cards { display: flex; flex-direction: column; gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.card.closed { opacity: .75; }
.card.skipped { opacity: .5; }
.card.closed .card-title, .card.skipped .card-title { text-decoration: line-through; }
.card-head { display: flex; align-items: flex-start; gap: 14px; }
.card-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-title { font-weight: 700; font-size: 17px; line-height: 1.25; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.card-status { margin-left: auto; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.card-problem { white-space: pre-wrap; line-height: 1.5; font-size: 14px; }
.ideas { display: flex; flex-direction: column; gap: 6px; }
.idea { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); font-size: 14px; line-height: 1.4; }
.idea.suggested { border-color: var(--accent); background: var(--accent-dim); }
.idea.picked { border-width: 2px; border-color: var(--accent); }
.pick { font-size: 14px; }
.drawer { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.drawer[hidden] { display: none; }   /* the class rule above outranks the browser's own hidden rule, so say it here */
.opt { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); display: flex; flex-direction: column; gap: 2px; }
.opt-title { font-weight: 700; }
.opt-toggle { align-self: flex-start; }
.note { font-size: 13px; border-left: 3px solid var(--accent); padding: 4px 10px; white-space: pre-wrap; }
.btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btns .btn { min-width: 44px; }
.go-btn { min-width: 96px; }

/* ---- phones ---- */
@media (max-width: 760px) {
  .agent-tabs button { padding: 10px 8px; font-size: 10.5px; min-height: 40px; }
  .agent-head { flex-direction: column; }
  .card { padding: 12px; }
  .btns .btn { min-height: 44px; }
}

/* ---- the health bars: five rows, three cells (24 h, 7 d, 30 d) coloured by band ---- */
.health { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.h-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.h-head .h3 { margin: 0; }
.h-window { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.h-window button { background: transparent; border: none; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.h-window button.on { background: var(--accent-dim); color: var(--accent); }
.h-grid { display: flex; flex-direction: column; gap: 6px; }
.h-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 6px; align-items: stretch; }
.h-labels .h-cell-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.h-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.h-name .small { font-weight: 400; }
.h-cell { border-radius: 8px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px solid transparent; color: #0f1115; }
.h-cell.on { border-color: var(--text); }
.h-cell .h-band { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.h-cell .h-val { font-size: 12px; }
.h-cell.great { background: #2fd4b2; }
.h-cell.good { background: #9fe0c3; }
.h-cell.bad { background: #f2c14e; }
.h-cell.ugly { background: #ff6b6b; }
.h-cell.quiet { background: var(--panel-2); color: var(--muted); border-color: var(--line); }
.h-cell.thin { background: var(--panel-2); color: var(--muted); border: 2px dashed var(--line); }   /* too few turns to trust; the number still shows */
.h-sum { line-height: 1.5; }
.h-kinds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; background: var(--bg); }
.h-table-wrap { overflow-x: auto; margin-top: 8px; }
.h-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.h-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.h-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.h-files { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--panel); margin-bottom: 14px; font-size: 13px; }
.h-none { margin-bottom: 14px; }

@media (max-width: 760px) {
  .h-row { grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 4px; }
  .h-name { font-size: 13px; }
  .h-name .small { display: none; }
  .h-cell { padding: 6px 2px; }
  .h-cell .h-band { font-size: 9.5px; letter-spacing: .04em; }
  .h-cell .h-val { font-size: 11px; }
  .h-window button { min-height: 40px; }
}

/* ---- the score out of 100 (Joey, 2026-09-26): beside the name, on the sub-tab, as the first row of the grid ---- */
.score-chip { display: inline-flex; align-items: baseline; gap: 4px; margin-left: 10px; padding: 2px 10px; border-radius: 10px; background: var(--accent-dim); color: var(--accent); font-size: 18px; font-weight: 800; vertical-align: middle; }
.score-chip small { font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.agent-tabs .score-mini { margin-left: 6px; font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-dim); border-radius: 6px; padding: 1px 5px; }
.h-cell.score { background: var(--accent-dim); color: var(--accent); }
.h-cell.score.part { border: 2px dashed var(--accent); }
.h-cell .h-score { font-size: 20px; font-weight: 800; line-height: 1; }
.h-cell .h-pts { font-size: 10px; opacity: .8; }
.h-profile { margin-bottom: 14px; }
.profile { white-space: pre-wrap; font-size: 12.5px; line-height: 1.5; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); margin-top: 8px; max-height: 420px; overflow-y: auto; }

/* ---- on a card: the bar it is aimed at, the points, where the fix lands, what needs Joey, the fix's result, the bar since the tap ---- */
.card-bar { border-radius: 6px; padding: 1px 7px; font-weight: 700; color: #0f1115; background: var(--panel-2); }
.card-bar.great { background: #2fd4b2; } .card-bar.good { background: #9fe0c3; } .card-bar.bad { background: #f2c14e; } .card-bar.ugly { background: #ff6b6b; }
.card-hunt { border: 1px solid var(--accent); color: var(--accent); border-radius: 6px; padding: 1px 7px; font-weight: 700; }
.target { color: var(--muted); }
.needs-you { border-left: 3px solid #f2c14e; padding: 4px 10px; background: var(--panel-2); border-radius: 0 8px 8px 0; }
.fixline { font-size: 13px; border-radius: 8px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); }
.fixline.done { border-color: #2fd4b2; } .fixline.failed { border-color: #ff6b6b; } .fixline.handed { border-color: #f2c14e; }
.fix-result { margin-top: 6px; white-space: pre-wrap; line-height: 1.45; }
.since { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.since .chip.great { background: #2fd4b2; color: #0f1115; } .since .chip.good { background: #9fe0c3; color: #0f1115; } .since .chip.bad { background: #f2c14e; color: #0f1115; } .since .chip.ugly { background: #ff6b6b; color: #0f1115; }

@media (max-width: 760px) {
  .score-chip { font-size: 15px; margin-left: 6px; padding: 1px 7px; }
  .h-cell .h-score { font-size: 16px; }
  .profile { max-height: 300px; }
}

/* ---- the tiles (Joey's pick of 2026-09-26, look 3): six across, the score and the five bars ---- */
.t-note { margin: -4px 0 8px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .lb { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 800; line-height: 1; }
.kpi.score { background: var(--accent-dim); border-color: transparent; } .kpi.score .v { font-size: 40px; color: var(--accent); }
.kpi .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t-panel { margin-bottom: 14px; }
.t-panel .h3 { margin-top: 0; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi.score { grid-column: 1 / -1; } .kpi .v { font-size: 22px; } }
