/* co dashboard: ops.css. Moved out of the Python modules (design-system's
   tokens plan, step 1, 2026-11-12); served by co_web at /static/css/ops.css. */
:root { --bg: #ffffff; --surface: #f6f8fa; --border: #d1d9e0; --text: #1f2328;
        --muted: #656d76; --accent: #0969da; --accent2: #1a7f37; --danger: #cf222e; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
       background: var(--surface); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { background: var(--bg); border-bottom: 1px solid var(--border); padding: .75rem 0; }
header .container { display: flex; align-items: center; gap: 1rem; }
header h1 { font-size: 16px; font-weight: 600; white-space: nowrap; }
header .subtitle { color: var(--muted); font-size: 13px; }
header nav { margin-left: auto; display: flex; gap: 14px; font-size: 14px; }
header nav a { color: var(--muted); text-decoration: none; }
header nav a:hover { color: var(--text); text-decoration: none; }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 20px 32px; }
.grid { display: grid; gap: 16px; margin-bottom: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
/* card shadow = skymonde --theme-shadow-card (brand-skymonde.css) */
.card, .stat { box-shadow: 0 0 2px 0 #1a232b14, 0 2px 4px 0 #1a232b29; }
.card h2 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase;
           letter-spacing: 0.5px; margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
table.agents { width: 100%; border-collapse: collapse; font-size: 13px; }
table.agents th { text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 600;
                  color: var(--muted); text-transform: uppercase; letter-spacing: .3px;
                  border-bottom: 2px solid var(--border); }
table.agents th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
table.agents th.sortable:hover { color: var(--text); }
table.agents th.sorted { color: var(--text); }
table.agents th .arrow { font-size: 9px; margin-left: 3px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.agent-search { display: flex; align-items: center; gap: 4px; }
.agent-search input { width: 0; padding: 0; border: 0; opacity: 0; outline: none;
    border-bottom: 1px solid var(--border); background: transparent; color: var(--text);
    font-size: 13px; transition: width .18s ease, opacity .18s ease, padding .18s ease; }
.agent-search.open input { width: 180px; padding: 3px 6px; opacity: 1; }
.agent-search button { background: none; border: 0; cursor: pointer; font-size: 15px;
    line-height: 1; color: var(--muted); padding: 2px 4px; }
.agent-search button:hover { color: var(--text); }
.agent-search.open button { color: var(--text); }
table.agents td { padding: 5px 10px; border-bottom: 1px solid var(--border); }
table.agents tr:last-child td { border-bottom: none; }
table.agents tr.row-working { background: #dafbe1; }
table.agents tr.row-question { background: #fff0f0; }
table.agents .section-label td { padding: 16px 10px 6px; font-size: 11px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: .3px; border-bottom: none; cursor: pointer; }
table.agents .section-label td:hover { color: var(--text); }
table.agents tr.hidden { display: none; }
table.agents .section-label .toggle { font-size: 10px; margin-right: 6px; display: inline-block;
    transition: transform .2s; }
table.agents .section-label .toggle.collapsed { transform: rotate(-90deg); }
table.agents .inactive-row.hidden { display: none; }
table.agents tr.unreadable-row { background: #fff8e1; }
table.agents .unreadable-cell { color: var(--border); }
table.agents tr.restart-row { background: #fff4e5; }
table.agents .restart-ctx { color: #8a4b00; font-weight: 600; }
.restart-badge { font-size: 10px; color: #8a4b00; background: #ffe8cc; border: 1px solid #f0c088;
                 border-radius: 3px; padding: 0 4px; white-space: nowrap; }
.unreadable-badge { font-size: 10px; color: #9a6700; background: #fff3cd; border: 1px solid #f0d98c;
    border-radius: 4px; padding: 0 4px; margin-left: 4px; cursor: help; white-space: nowrap; }
.agent-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot-working { background: var(--accent2); box-shadow: 0 0 6px rgba(26,127,55,.4); }
.dot-idle { background: #bf8700; }
.dot-question { background: #8250df; }
.dot-dead { background: var(--danger); }
.dot-detached { background: var(--border); }
.dot-compacting { background: #e16f24; box-shadow: 0 0 6px rgba(225,111,36,.6); animation: pulse-compacting 1.6s ease-in-out infinite; }
@keyframes pulse-compacting { 0%,100%{opacity:1} 50%{opacity:.4} }
.status-working { color: var(--accent2); font-weight: 600; }
.status-question { color: #8250df; font-weight: 600; }
.status-idle { color: var(--muted); }
.status-inactive { color: var(--border); }
.status-compacting { color: #bc4c00; font-weight: 600; }
table.agents td.num, table.agents th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* the model gets room (7.5rem) and ellipsizes instead of wrapping or pushing the row wider */
table.agents td.model { min-width: 7.5rem; max-width: 11rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pct-cool { color: var(--muted); }
.pct-warm { color: #bf8700; font-weight: 600; }
.pct-hot { color: var(--danger); font-weight: 600; }
.chart-container { position: relative; height: 260px; min-height: 200px; }
/* A grid track must be able to shrink below a chart canvas's last rendered
   width (Chart.js fixes the canvas's pixel width), or when the panel narrows
   the whole row keeps the old width and runs past the panel's edge. */
.grid > * { min-width: 0; }
.chart-container canvas { max-width: 100%; }
.tool-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.tool-bar .name { font-size: 13px; color: var(--text); width: 140px; text-align: right;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0;
                  cursor: default; }
.tool-bar .bar-wrap { flex: 1; }
.tool-bar .bar { height: 22px; background: var(--accent); border-radius: 3px; min-width: 3px; opacity: .8; }
.tool-bar .count { font-size: 12px; color: var(--muted); margin-left: 6px; white-space: nowrap; flex-shrink: 0; }
.controls { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.ctrl-btn { background: var(--bg); border: 1px solid var(--border); color: var(--muted);
            padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.ctrl-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ctrl-btn:hover { border-color: var(--accent); }
.controls-sep { width: 1px; background: var(--border); margin: 0 4px; }
