/* Settings (admin.html) — tabbed shell + API keys, risk profiles, audit log. Builds on style.css tokens. */

/* page title — sits above the tabs */
.set-page-title { font-family: 'Onest', sans-serif; font-size: 32px; font-weight: 700; letter-spacing: -0.022em; color: var(--ink-1); margin: 0 0 16px; }

/* tabs */
.set-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; flex-wrap: wrap; }

/* per-tab subheader — small context line under the tab row */
.set-subhead { font-size: 14px; color: var(--ink-2); line-height: 1.55; max-width: 78ch; margin: 14px 0 24px; }
.set-subhead:empty { display: none; }
.set-tab { padding: 11px 16px; border: none; background: none; font-family: 'Onest', sans-serif; font-size: 14px; font-weight: 500; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .14s; }
.set-tab:hover { color: var(--ink-1); }
.set-tab.is-on { color: var(--signal); border-bottom-color: var(--signal); font-weight: 600; }
.set-panel { display: none; }
.set-panel.is-on { display: block; }

/* page header within a panel */
.set-eyebrow { font-family: 'SUSE Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
.set-h1 { font-family: 'Onest', sans-serif; font-size: 30px; font-weight: 700; letter-spacing: -0.022em; color: var(--ink-1); margin: 0 0 6px; }
.set-lede { font-size: 14px; color: var(--ink-2); line-height: 1.55; margin: 0 0 20px; max-width: 70ch; }
.set-note { font-size: 13px; color: var(--ink-2); line-height: 1.55; background: rgba(28,122,254,0.05); border-radius: 12px; padding: 14px 16px; margin: 0 0 22px; }

/* generic settings card */
.set-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: 0 8px 24px rgba(17,30,69,0.05); margin-bottom: 18px; }
.set-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.set-card-title { font-size: 16px; font-weight: 600; color: var(--ink-1); margin: 0; }
.set-card-sub { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 16px; }

/* ── API keys table ── */
.api-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.api-table th { text-align: left; font-family: 'SUSE Mono', monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.api-table td { padding: 16px 14px; border-bottom: 1px solid rgba(17,30,69,0.05); color: var(--ink-1); vertical-align: middle; }
.api-table tbody tr:last-child td { border-bottom: none; }
.api-table tbody tr:hover { background: rgba(28,122,254,0.02); }
.api-name { font-weight: 600; }
.api-secret, .api-date { font-family: 'SUSE Mono', monospace; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.api-by { color: var(--ink-2); }
.api-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--matrix-deep); border: 1px solid rgba(31,184,121,0.3); border-radius: 100px; padding: 3px 11px; }
.api-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--matrix); }
.api-kebab { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--ink-3); font-size: 16px; line-height: 1; }
.api-kebab:hover { background: rgba(17,30,69,0.03); }

/* ── Risk profiles gallery ── */
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rp-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; background: #fff; box-shadow: 0 8px 24px rgba(17,30,69,0.05); display: flex; flex-direction: column; transition: border-color .14s, box-shadow .14s; }
.rp-card.active { position: relative; border-color: rgba(31,184,121,0.45); background: linear-gradient(165deg, rgba(31,184,121,0.06), rgba(31,184,121,0.01)); box-shadow: 0 8px 24px rgba(31,184,121,0.10); }
.rp-active-badge { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 5px; background: var(--matrix); color: #fff; font-family: 'SUSE Mono', monospace; font-size: 10px; letter-spacing: 0.04em; padding: 5px 11px; border-radius: 100px; }
.rp-active-badge i { width: 12px; height: 12px; }
.rp-card-top { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.rp-type { font-family: 'SUSE Mono', monospace; font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 100px; }
.rp-type.flags { background: rgba(28,122,254,0.1); color: var(--signal); }
.rp-type.evidence { background: rgba(229,163,58,0.14); color: var(--gold-deep); }
.rp-badge { display: inline-flex; align-items: center; gap: 5px; font-family: 'SUSE Mono', monospace; font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 100px; background: rgba(30,26,78,0.08); color: var(--indigo-500); }
.rp-badge i { width: 12px; height: 12px; }
.rp-viewonly { font-size: 12.5px; color: var(--ink-3); font-style: italic; margin: 2px 0 0; }
.rp-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 22px; flex-wrap: wrap; }
.rp-bar-actions { display: flex; gap: 10px; }
.rp-section-label { font-family: 'SUSE Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.rp-btn i { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.rp-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 6px; }
.rp-create-explain { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin: 14px 0 0; }
.rp-type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.rp-type-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: #fff; transition: border-color .14s, box-shadow .14s, background .14s; }
.rp-type-card.is-on { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); background: rgba(28,122,254,0.04); }
.rp-type-card-h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-1); margin-bottom: 8px; }
.rp-type-card-h i { width: 16px; height: 16px; color: var(--signal); }
.rp-type-card-sub { font-size: 12px; color: var(--ink-3); line-height: 1.45; margin: 0 0 10px; }
.rp-type-card-body { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0; }
@media (max-width: 760px) { .rp-create-grid { grid-template-columns: 1fr; } .rp-type-cards { grid-template-columns: 1fr; } }
.rp-name { font-size: 16px; font-weight: 600; color: var(--ink-1); margin: 0 0 4px; }
.rp-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; flex: 1; margin: 0 0 14px; }
.rp-meta { font-size: 11.5px; color: var(--ink-4); margin: 0 0 14px; }
.rp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-btn { padding: 8px 14px; border-radius: 9px; font-family: 'Onest', sans-serif; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.rp-btn:hover { border-color: rgba(17,30,69,0.2); }
.rp-btn--primary { background: var(--signal); border-color: var(--signal); color: #fff; }
.rp-btn--primary:hover { background: #1565d8; }
.rp-new { border: 1.5px dashed var(--line-2, rgba(17,30,69,0.18)); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); cursor: pointer; min-height: 180px; background: rgba(17,30,69,0.015); }
.rp-new:hover { border-color: var(--signal); color: var(--signal); background: rgba(28,122,254,0.03); }
.rp-new i { width: 26px; height: 26px; }

/* ── Risk profile editor (Categories & Flags) ── */
.rp-editor-back { display: inline-flex; align-items: center; gap: 7px; border: none; background: none; color: var(--signal); font-family: 'Onest', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px; }
.cfl-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.cfl-actions { display: flex; gap: 8px; }
.cfl-tips { display: flex; gap: 11px; align-items: flex-start; background: rgba(28,122,254,0.05); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.cfl-tips i { width: 17px; height: 17px; color: var(--signal); flex-shrink: 0; margin-top: 1px; }
.cfl-tips-body { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.cfl-tips-body b { color: var(--ink-1); font-weight: 600; display: block; margin-bottom: 2px; }
.cfl-cat { border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 12px; box-shadow: 0 6px 18px rgba(17,30,69,0.04); overflow: hidden; }
.cfl-cat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; }
.cfl-cat-caret { color: var(--ink-3); transition: transform .2s; display: inline-flex; }
.cfl-cat-caret i { width: 16px; height: 16px; }
.cfl-cat.open .cfl-cat-caret { transform: rotate(180deg); }
.cfl-cat-name { font-size: 16px; font-weight: 600; color: var(--ink-1); }
.cfl-cat-count { font-family: 'SUSE Mono', monospace; font-size: 10.5px; color: var(--ink-3); background: rgba(28,122,254,0.08); border-radius: 100px; padding: 3px 9px; }
.cfl-cat-tools { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.cfl-icon-btn { border: none; background: none; cursor: pointer; color: var(--ink-3); display: inline-flex; padding: 4px; }
.cfl-icon-btn:hover { color: var(--ink-1); }
.cfl-icon-btn.danger:hover { color: var(--adverse); }
.cfl-icon-btn i { width: 16px; height: 16px; }
.cfl-cat-body { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.cfl-cat.open .cfl-cat-body { display: block; }
.cfl-flag { padding: 14px 0; border-bottom: 1px solid rgba(17,30,69,0.05); }
.cfl-flag:last-child { border-bottom: none; }
.cfl-flag-name { font-size: 14px; font-weight: 600; color: var(--ink-1); margin: 0 0 3px; }
.cfl-flag-desc { font-size: 13px; color: var(--ink-3); line-height: 1.5; margin: 0; }
/* add-category form */
.cfl-form { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 20px 22px; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(17,30,69,0.05); }
.cfl-label { font-size: 14px; font-weight: 600; color: var(--ink-1); display: block; margin-bottom: 8px; }
.cfl-sublabel { font-size: 12.5px; color: var(--ink-3); margin: 0 0 8px; }
.cfl-input, .cfl-textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: 'Onest', sans-serif; font-size: 14px; color: var(--ink-1); outline: none; background: #fff; }
.cfl-input:focus, .cfl-textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(28,122,254,0.08); }
.cfl-textarea { min-height: 90px; resize: vertical; margin-bottom: 16px; }
.cfl-form-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

/* ── Audit log table ── */
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th { text-align: left; font-family: 'SUSE Mono', monospace; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.audit-table td { padding: 13px 14px; border-bottom: 1px solid rgba(17,30,69,0.05); color: var(--ink-1); }
.audit-table tbody tr:last-child td { border-bottom: none; }
.audit-when { font-family: 'SUSE Mono', monospace; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.audit-action { color: var(--ink-2); }
.audit-target { font-weight: 500; }
/* Lucide renders <i> as <svg> — size the rendered icons in the settings content */
.canvas-wrap svg { width: 15px; height: 15px; }
.rp-active-badge svg { width: 12px; height: 12px; }
.rp-badge svg { width: 12px; height: 12px; }
.rp-btn svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.rp-type-card-h svg { width: 16px; height: 16px; }
.cfl-cat-caret svg, .cfl-tips svg, .cfl-icon-btn svg { width: 16px; height: 16px; }
.set-tab svg { width: 15px; height: 15px; }
