/* Agents page (per-agent keys / Connect screen).
   Layered on style.css; uses only its variables so it follows the theme. */

.lede { color: var(--muted); margin: 0 0 22px; max-width: 720px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 6px; }
.page-head .grow { flex: 1; }
.step { font-family: var(--mono); font-size: 11px; color: var(--accent3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }

/* permission segmented control: allow / ask first / block */
.seg { display: inline-flex; flex: none; white-space: nowrap; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; background: #fff; }
.seg button { padding: 4px 8px; border-radius: 0; font-size: 12px; font-weight: 600; background: transparent; color: var(--muted); box-shadow: none; border: none; }
.seg button:hover { transform: none; box-shadow: none; color: var(--fg); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.sel.allow { background: var(--green-soft); color: var(--green); }
.seg button.sel.hold { background: var(--amber-soft); color: var(--yellow); }
.seg button.sel.block { background: var(--red-soft); color: var(--red); }
.seg.ro button { cursor: default; }

.agents-table td { vertical-align: middle; }
.agents-table td.nm { font-weight: 600; color: var(--fg); }
.agents-table tr.revoked td { opacity: .5; }
.pill.warn { background: var(--amber-soft); color: var(--yellow); border-color: #e6d3a8; }

/* template choices */
.choice { border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; margin-bottom: 10px; background: #fff; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.choice.sel { border-color: var(--accent); background: var(--green-soft); }
.choice .radio { width: 16px; height: 16px; border: 1px solid var(--border); border-radius: 50%; flex: none; margin-top: 3px; position: relative; }
.choice.sel .radio { border-color: var(--accent); }
.choice.sel .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.choice b { display: block; font-size: 14px; }
.choice .muted { font-size: 13px; }

.perm-grid { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; align-items: center; margin-top: 6px; }
.perm-grid .lbl { font-size: 13px; color: var(--muted); }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(34,41,35,.35); z-index: 200; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 48px 16px; }
.modal-back.open { display: flex; }
.modal { width: 100%; max-width: 720px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 28px; box-shadow: 0 30px 60px -30px rgba(36,55,36,.45); }
.modal h2 { font-size: 20px; }
.keyrow { margin-bottom: 14px; }
.keyrow label { margin-bottom: 6px; }
.keyrow .line { display: flex; gap: 10px; align-items: stretch; }
.keyrow .codeblock { flex: 1; margin: 0; padding: 11px 14px; }
.keyrow button { flex: none; align-self: center; }
.once { border: 1px solid #e6d3a8; background: var(--amber-soft); border-radius: 4px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; }
.once b { color: var(--yellow); }
select { width: 100%; padding: 12px 14px; border-radius: 3px; border: 1px solid var(--border); background: #fff; color: var(--fg); font-size: 14px; font-family: inherit; }

.table-scroll { overflow-x: auto; }
.perm-mini { display: grid; grid-template-columns: 56px max-content; gap: 6px 10px; align-items: center; }
.perm-mini .lbl { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.agents-table td { white-space: nowrap; }
.agents-table td.nm { white-space: normal; }

/* db_role */
.role-help { font-size: 12px; margin: 6px 0 0; }
.role-hint { white-space: normal; max-width: 300px; font-size: 13px; margin: 8px 0 0; padding: 8px 10px; border-radius: 4px; border: 1px solid var(--accent); background: var(--green-soft); }
.role-hint button { margin-left: 8px; padding: 3px 10px; font-size: 12px; }
.role-cell { font-family: var(--mono); font-size: 12px; }
.role-cell .muted { font-family: inherit; }
.role-cell button { margin-left: 6px; padding: 2px 8px; font-size: 11px; }
.role-cell .role-hint { font-family: var(--font, inherit); font-size: 12px; margin-top: 6px; padding: 6px 8px; }

/* keep the row inside the card: key column truncates instead of pushing Revoke out */
.agents-table td.key { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.agents-table th, .agents-table td { padding-left: 6px; padding-right: 6px; }
