/* ── Shared page-level components ─────────────────────────────── */
.detail-section {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 22px 24px; margin-bottom: 18px;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 14px 0 4px; }
.tab { padding: 8px 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text-1); text-decoration: none; }
.tab-active { color: var(--text-1); border-bottom-color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .93rem; }
th { color: var(--text-2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

.status-badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem;
    border: 1px solid var(--border); background: var(--bg-2);
}
.status-badge.status-ok    { border-color: var(--success); color: var(--success); }
.status-badge.status-warn  { border-color: var(--warning);  color: var(--warning); }
.status-badge.status-error { border-color: var(--danger);   color: var(--danger); }

.grav-row { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--bg-2); }

/* ── Chat widget ───────────────────────────────────────────────── */
.chat-widget { position: fixed; right: 18px; bottom: 18px; z-index: 100; }
.chat-toggle {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-1); color: var(--text-2);
    font-size: 1.1rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    transition: background 120ms, color 120ms, transform 120ms;
}
.chat-toggle:hover { background: var(--accent); color: #fff; transform: scale(1.05); }
.chat-panel {
    position: absolute; right: 0; bottom: 64px; width: 360px; height: 480px;
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 12px;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 36px rgba(0,0,0,.18);
    animation: chat-pop 160ms ease-out;
}
.chat-panel[hidden] { display: none; }
@keyframes chat-pop { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.chat-close { background: none; border: none; color: var(--text-2); font-size: 1.3rem; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg {
    max-width: 86%; padding: 8px 12px; border-radius: 12px; font-size: .92rem;
    line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
}
.chat-msg.user      { align-self: flex-end; background: var(--accent); color: #fff; }
.chat-msg.assistant { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--border); }
.chat-msg.error     { align-self: flex-start; background: #fff0f0; border: 1px solid var(--danger); color: var(--danger); }
[data-theme="dark"] .chat-msg.error { background: #2a1414; color: #f0b6b6; }
.chat-typing { align-self: flex-start; color: var(--text-2); font-size: .85rem; font-style: italic; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input { flex: 1; }
.chat-send { padding: 8px 14px; background: var(--accent); border: none; color: #fff; border-radius: 6px; cursor: pointer; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   APPLICATION LIST
   ═══════════════════════════════════════════════════════════════ */

/* Filter chips */
.filter-chip {
    display: inline-flex; align-items: center;
    padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600;
    border: 1px solid var(--border); background: var(--bg-1); color: var(--text-2);
    white-space: nowrap; transition: all 120ms;
}
.filter-chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.filter-chip-active { border-color: var(--accent); background: var(--accent); color: #fff !important; }
.chip-blocked  { border-color: #f5c6cb; color: #9b1c1c; }
.chip-migrated { border-color: #c3e6cb; color: #155724; }
.chip-testing  { border-color: #ffeeba; color: #6b4a0a; }

/* App card grid */
.app-cards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.app-card {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 18px 20px; color: inherit;
    transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.app-card:hover {
    border-color: var(--accent); box-shadow: 0 4px 16px rgba(227,24,55,.09);
    text-decoration: none; transform: translateY(-2px);
}
.app-card-top  { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.app-card-name { font-weight: 700; font-size: .97rem; color: var(--text-1); line-height: 1.3; }
.app-card-desc { font-size: .82rem; color: var(--text-2); line-height: 1.45; }
.app-card-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: .78rem; color: var(--text-2); margin-top: 4px;
}
.app-card-blocker {
    font-size: .78rem; color: var(--accent); font-weight: 500;
    background: #fff0f0; border: 1px solid #f5c6cb; border-radius: 5px;
    padding: 5px 8px; margin-top: 4px;
}
[data-theme="dark"] .app-card-blocker { background: #2a0d0d; border-color: #5a1a1a; }

/* Dashboard security posture tiles */
.dash-security-row { display:flex; gap:14px; }
.security-tiles { display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
@media (max-width:1000px) { .security-tiles { grid-template-columns:repeat(3,1fr); } }
@media (max-width:650px)  { .security-tiles { grid-template-columns:repeat(2,1fr); } }
.sec-tile { border-radius:8px; padding:14px 16px; border:1px solid var(--border); background:var(--bg-0); text-align:center; }
.sec-tile-warn    { border-color:#f5c6cb; background:#fff8f8; }
.sec-tile-ok      { border-color:#c3e6cb; background:#f8fff9; }
.sec-tile-neutral { border-color:var(--border); background:var(--bg-0); }
[data-theme="dark"] .sec-tile-warn { border-color:#5a1a1a; background:#1e0d0d; }
[data-theme="dark"] .sec-tile-ok   { border-color:#1e4029; background:#0d1a10; }
.sec-tile-num   { font-size:1.8rem; font-weight:900; line-height:1; color:var(--text-1); }
.sec-tile-warn .sec-tile-num { color:var(--accent); }
.sec-tile-label { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-2); margin:5px 0 3px; }
.sec-tile-sub   { font-size:.72rem; color:var(--text-2); line-height:1.4; }

/* App card progress bars */
.app-card-progress { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.app-card-progress-row { display: flex; align-items: center; gap: 7px; }
.app-card-progress-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-2); width: 36px; flex-shrink: 0;
}
.app-card-progress-track {
    flex: 1; height: 5px; background: var(--bg-2); border-radius: 999px; overflow: hidden;
}
.app-card-progress-fill {
    height: 100%; border-radius: 999px; transition: width .4s ease;
}
.app-card-progress-pct {
    font-size: .68rem; color: var(--text-2); width: 30px; text-align: right; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   APPLICATION DETAIL
   ═══════════════════════════════════════════════════════════════ */

.back-link { font-size: .85rem; color: var(--text-2); }
.back-link:hover { color: var(--accent); }

/* Project sub-nav — migration-specific areas, scoped to the project view */
.proj-subnav {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin: 18px 0 22px;
}
.proj-subnav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px; font-size: .88rem; font-weight: 600;
    color: var(--text-2); border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.proj-subnav-link:hover { color: var(--text-1); text-decoration: none; }
.proj-subnav-link.active { color: var(--text-1); border-bottom-color: var(--accent); }

/* ── Project settings / generic form field ─────────────────────── */
.pj-field {
    display: flex; flex-direction: column; gap: 5px;
    font-size: .85rem; font-weight: 600; color: var(--text-1);
}
.pj-field input,
.pj-field select,
.pj-field textarea {
    font-weight: 400; font-size: .88rem; color-scheme: light dark;
}
.pj-field small,
.pj-field .pj-hint { font-size: .75rem; font-weight: 400; color: var(--text-2); margin-top: 1px; }

/* Two-column grid used inside project-settings sections */
.ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ps-grid .span-2 { grid-column: 1 / -1; }

/* Option card — checkbox or radio row inside a bordered label */
.opt-card {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; transition: border-color 120ms;
}
.opt-card:hover { border-color: var(--border-strong, #3a3a3a); }
.opt-card.selected { border-color: var(--accent); background: rgba(227,24,55,.03); }
.opt-card input[type=checkbox],
.opt-card input[type=radio] { margin-top: 3px; flex-shrink: 0; width: auto; }
.opt-card-body strong { font-size: .88rem; display: block; margin-bottom: 2px; }
.opt-card-body span { font-size: .79rem; color: var(--text-2); }

@media (max-width: 700px) { .ps-grid { grid-template-columns: 1fr; } }

/* Header */
.app-header {
    display: flex; gap: 32px; justify-content: space-between; align-items: flex-start;
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 24px 28px; margin-bottom: 16px; flex-wrap: wrap;
}
.app-header-left { flex: 1; min-width: 0; }
.app-header-name { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.app-name-editable { cursor: text; border-radius: 4px; transition: background .15s; }
.app-name-editable:hover { background: var(--bg-2, #2a2a2a); }
.app-name-editable::after { content: ' ✎'; font-size: .9rem; font-weight: 400; opacity: 0; color: var(--text-2); transition: opacity .15s; vertical-align: middle; }
.app-name-editable:hover::after { opacity: 1; }
.app-header-desc { color: var(--text-2); margin-top: 10px; line-height: 1.6; max-width: 640px; }
.status-pill-lg  { font-size: .8rem; padding: 4px 12px; }
.priority-badge  {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 3px 9px; border-radius: 999px;
}
.priority-critical { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5c6cb; }
.priority-high     { background: #fff3cd; color: #6b4a0a; border: 1px solid #ffeeba; }
[data-theme="dark"] .priority-critical { background: #2a0d0d; color: #f08080; border-color: #5a1a1a; }
[data-theme="dark"] .priority-high     { background: #2a1e00; color: #f0c060; border-color: #4a3000; }

.blocker-alert {
    display: flex; align-items: flex-start; gap: 8px;
    background: #fff0f0; border: 1px solid #f5c6cb; border-radius: 6px;
    padding: 10px 14px; margin-top: 12px; font-size: .88rem; color: #7a1a1a;
    max-width: 640px;
}
[data-theme="dark"] .blocker-alert { background: #2a0d0d; border-color: #5a1a1a; color: #f08080; }
.blocker-icon { font-size: 1rem; flex-shrink: 0; }

.app-header-meta {
    display: flex; flex-direction: column; gap: 10px;
    min-width: 220px; flex-shrink: 0;
}
.meta-row  { display: flex; align-items: baseline; gap: 10px; font-size: .88rem; }
.meta-label { color: var(--text-2); min-width: 90px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }

/* KPI row */
.app-kpi-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 12px; margin-bottom: 20px;
}
@media (max-width: 800px) { .app-kpi-row { grid-template-columns: repeat(2,1fr); } }
.app-kpi-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 18px 20px;
}
.app-kpi-num   { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.app-kpi-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-top: 6px; }

/* Body: plan + notes */
.app-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .app-body { grid-template-columns: 1fr; } }

.app-plan-card,
.app-notes-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 22px 24px;
}
.app-plan-card h3,
.app-notes-card h3 { margin: 2px 0 18px; font-size: 1rem; }

/* Step list */
.step-list { list-style: none; display: flex; flex-direction: column; }
.step-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.step-item:last-child { border-bottom: none; }
.step-num {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; margin-top: 1px;
    background: var(--bg-2); color: var(--text-2);
}
.step-item-done     .step-num { background: #d4edda; color: #155724; }
.step-item-blocked  .step-num { background: #fde8e8; color: #9b1c1c; }
.step-item-in_progress .step-num { background: #dde8f5; color: #1a3a5c; }
[data-theme="dark"] .step-item-done    .step-num { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .step-item-blocked .step-num { background: #2a0d0d; color: #f08080; }
[data-theme="dark"] .step-item-in_progress .step-num { background: #0d1e2a; color: #8ab4d8; }

.step-body   { flex: 1; min-width: 0; }
.step-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.step-title  { font-size: .9rem; font-weight: 600; }
.step-done-title { color: var(--text-2); text-decoration: line-through; }
.step-notes  { font-size: .8rem; color: var(--text-2); margin-top: 3px; }
.step-due    { font-size: .75rem; color: var(--text-2); margin-top: 3px; }

.step-pill {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.step-pill-done        { background: #d4edda; color: #155724; }
.step-pill-pending     { background: #f0f0f0; color: #5a5a5a; }
.step-pill-in_progress { background: #dde8f5; color: #1a3a5c; }
.step-pill-blocked     { background: #fde8e8; color: #9b1c1c; }
.step-pill-skipped     { background: #f0f0f0; color: #888; }
[data-theme="dark"] .step-pill-done        { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .step-pill-pending     { background: #222;    color: #888; }
[data-theme="dark"] .step-pill-in_progress { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .step-pill-blocked     { background: #2a0d0d; color: #f08080; }

.step-form   { margin-left: auto; flex-shrink: 0; }
.step-select {
    font-size: .78rem; padding: 4px 8px; width: auto;
    border-radius: 5px; cursor: pointer;
}
.migrated-num { color: var(--success); }

/* ── Activity log ───────────────────────────────────────────────── */
.log-cat-badge {
    display: inline-block; padding: 1px 7px; border-radius: 999px;
    font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    white-space: nowrap; flex-shrink: 0;
}
.log-cat-auth    { background: #dde8f5; color: #1a3a5c; }
.log-cat-ai      { background: #f0e8ff; color: #5b21b6; }
.log-cat-admin   { background: #fde8e8; color: #9b1c1c; }
.log-cat-app     { background: #d4edda; color: #155724; }
.log-cat-file    { background: #fff3cd; color: #6b4a0a; }
.log-cat-general { background: #f0f0f0; color: #555; }
[data-theme="dark"] .log-cat-auth    { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .log-cat-ai      { background: #1e0d3a; color: #c4b5fd; }
[data-theme="dark"] .log-cat-admin   { background: #2a0d0d; color: #f08080; }
[data-theme="dark"] .log-cat-app     { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .log-cat-file    { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .log-cat-general { background: #222; color: #888; }

/* ── Security gates ────────────────────────────────────────────── */
.tab-gate-badge {
    display: inline-flex; align-items: center;
    font-size: .65rem; font-weight: 800; padding: 1px 6px; border-radius: 999px;
    margin-left: 5px; vertical-align: middle;
}
.tab-gate-done    { background: #d4edda; color: #155724; }
.tab-gate-partial { background: #fff3cd; color: #6b4a0a; }
.tab-gate-none    { background: #f0f0f0; color: #666; }
[data-theme="dark"] .tab-gate-done    { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .tab-gate-partial { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .tab-gate-none    { background: #222; color: #888; }

.gates-list { display: flex; flex-direction: column; gap: 8px; }
.gate-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
    border-left: 4px solid var(--border);
}
.gate-card-passed     { border-left-color: var(--success); }
.gate-card-failed     { border-left-color: var(--danger); }
.gate-card-in_progress{ border-left-color: #4a90d9; }
.gate-card-waived     { border-left-color: #e6a817; }
.gate-card-pending    { border-left-color: var(--border); }

.gate-card-top {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px;
}
.gate-num {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 800; background: var(--bg-2); color: var(--text-2);
    margin-top: 1px;
}
.gate-card-passed  .gate-num { background: #d4edda; color: #155724; }
.gate-card-failed  .gate-num { background: #fde8e8; color: #9b1c1c; }
[data-theme="dark"] .gate-card-passed .gate-num { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .gate-card-failed .gate-num { background: #2a0d0d; color: #f08080; }

.gate-body    { flex: 1; min-width: 0; }
.gate-name    { font-weight: 700; font-size: .92rem; color: var(--text-1); }
.gate-meta    { display: flex; gap: 12px; font-size: .75rem; color: var(--text-2); margin-top: 3px; flex-wrap: wrap; }
.gate-notes   { font-size: .82rem; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.gate-evidence{ font-size: .78rem; color: var(--accent); margin-top: 3px; }

.gate-status-badge {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.gate-passed     { background: #d4edda; color: #155724; }
.gate-failed     { background: #fde8e8; color: #9b1c1c; }
.gate-in_progress{ background: #dde8f5; color: #1a3a5c; }
.gate-pending    { background: #f0f0f0; color: #666; }
.gate-waived     { background: #fff3cd; color: #6b4a0a; }
[data-theme="dark"] .gate-passed      { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .gate-failed      { background: #2a0d0d; color: #f08080; }
[data-theme="dark"] .gate-in_progress { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .gate-pending     { background: #222;    color: #888; }
[data-theme="dark"] .gate-waived      { background: #2a1e00; color: #f0c060; }

.gate-edit-form { padding: 0 16px 14px; border-top: 1px solid var(--border); background: var(--bg-0); }
.gate-form-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
@media (max-width: 700px) { .gate-form-grid { grid-template-columns: 1fr; } }

/* ── App tabs ──────────────────────────────────────────────────── */
.app-tabs { }
.app-tab-nav {
    display: flex; gap: 2px; border-bottom: 2px solid var(--border);
    margin-bottom: 20px; flex-wrap: wrap;
}
.app-tab-btn {
    padding: 10px 16px; border: none; background: transparent;
    color: var(--text-2); font: inherit; font-size: .88rem; font-weight: 600;
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
    border-radius: 6px 6px 0 0; transition: color 120ms, border-color 120ms;
    white-space: nowrap;
}
.app-tab-btn:hover { color: var(--text-1); background: var(--bg-2); }
.app-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: transparent; }

/* Architecture tab layout */
.arch-layout {
    display: grid; grid-template-columns: 1.6fr 1fr;
    gap: 16px; align-items: start;
}
@media (max-width: 900px) { .arch-layout { grid-template-columns: 1fr; } }

.mermaid-wrap {
    background: var(--bg-0); border: 1px solid var(--border);
    border-radius: 8px; padding: 16px; overflow-x: auto;
    min-height: 200px;
}
.mermaid-wrap svg { max-width: 100%; height: auto; }

/* App intelligence block — description + research integrated */
.app-intel-block      { display: flex; flex-direction: column; gap: 10px; }
.app-intel-desc-row   { display: flex; align-items: flex-start; gap: 14px; }

.app-intel-entra {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 8px 12px; border-radius: 6px;
    background: rgba(74,144,217,.08); border: 1px solid rgba(74,144,217,.2);
    font-size: .84rem; line-height: 1.6;
}
[data-theme="dark"] .app-intel-entra { background: rgba(74,144,217,.06); border-color: rgba(74,144,217,.15); }
.app-intel-entra-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #4a90d9; white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.app-intel-entra-text  { color: var(--text-1); }

.app-intel-details { margin-top: 2px; }
.app-intel-details-summary {
    cursor: pointer; font-size: .8rem; color: var(--text-2);
    list-style: none; padding: 4px 0;
}
.app-intel-details-summary::-webkit-details-marker { display: none; }
.app-intel-details-summary::before { content: "▸ "; font-size: .75rem; }
details[open].app-intel-details .app-intel-details-summary::before { content: "▾ "; }
.app-intel-details-summary:hover { color: var(--text-1); }

/* Description inline editor */
.desc-editor  { border: none; }
.desc-summary {
    cursor: pointer; color: var(--text-2); font-size: .95rem; line-height: 1.6;
    max-width: 640px; display: flex; gap: 10px; align-items: flex-start;
    list-style: none;
}
.desc-summary::-webkit-details-marker { display: none; }
.desc-edit-hint {
    font-size: .75rem; color: var(--accent); font-weight: 600;
    white-space: nowrap; flex-shrink: 0; margin-top: 3px;
    opacity: 0; transition: opacity 120ms;
}
.desc-summary:hover .desc-edit-hint { opacity: 1; }
details[open] .desc-summary { color: var(--text-1); }

/* ═══════════════════════════════════════════════════════════════
   FAQ
   ═══════════════════════════════════════════════════════════════ */

/* Public FAQ */
.faq-category-title {
    font-size: .75rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--accent);
    margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}
.faq-item {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 8px; overflow: hidden;
}
.faq-question {
    padding: 14px 18px; cursor: pointer; font-weight: 700; font-size: .95rem;
    list-style: none; display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: "▾"; color: var(--text-2); font-size: .8rem; flex-shrink: 0; transition: transform 200ms; }
details[open] .faq-question::after { transform: rotate(-180deg); }
.faq-question:hover { color: var(--accent); }
.faq-answer {
    padding: 0 18px 16px; font-size: .9rem; line-height: 1.7;
    color: var(--text-1); border-top: 1px solid var(--border);
    padding-top: 12px;
}
.faq-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: .78rem; color: var(--text-2); }
.faq-helpful-btn {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px;
    padding: 3px 10px; font-size: .78rem; cursor: pointer; color: var(--text-2);
}
.faq-helpful-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Admin FAQ management */
.faq-manage-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 18px;
}
.faq-manage-top { display: flex; gap: 14px; align-items: flex-start; }

/* Chat log */
.chat-log-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 18px;
}
.log-card-promoted { border-color: #c3e6cb; background: #f8fff9; }
[data-theme="dark"] .log-card-promoted { border-color: #1e4029; background: #0d1a10; }
.chat-log-meta {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    font-size: .78rem; color: var(--text-2); margin-bottom: 10px;
}
.chat-log-q {
    background: var(--bg-2); border-radius: 6px; padding: 10px 14px;
    font-size: .88rem; font-weight: 600; margin-bottom: 8px;
}
.chat-log-a {
    font-size: .86rem; line-height: 1.65; color: var(--text-2); padding: 0 4px;
    max-height: 100px; overflow: hidden; mask-image: linear-gradient(to bottom, black 60%, transparent);
}
.chat-log-card:hover .chat-log-a { max-height: none; mask-image: none; }
.promote-summary {
    cursor: pointer; font-size: .82rem; color: var(--accent); font-weight: 600;
    list-style: none;
}
.promote-summary::-webkit-details-marker { display: none; }

/* ═══════════════════════════════════════════════════════════════
   BC/DR PLAN
   ═══════════════════════════════════════════════════════════════ */

.bcdr-status {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.bcdr-draft        { background: #f0f0f0; color: #666; }
.bcdr-reviewed     { background: #dde8f5; color: #1a3a5c; }
.bcdr-approved     { background: #d4edda; color: #155724; }
.bcdr-needs_update { background: #fde8e8; color: #9b1c1c; }
[data-theme="dark"] .bcdr-draft        { background: #222; color: #888; }
[data-theme="dark"] .bcdr-reviewed     { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .bcdr-approved     { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .bcdr-needs_update { background: #2a0d0d; color: #f08080; }

.bcdr-inline-badge {
    font-size: .65rem; font-weight: 800; padding: 1px 5px; border-radius: 3px;
    margin-left: 4px; vertical-align: middle;
}

.bcdr-section {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 20px 22px; margin-bottom: 14px;
}
.bcdr-section-title {
    font-weight: 800; font-size: .82rem; text-transform: uppercase;
    letter-spacing: .07em; color: var(--accent); margin-bottom: 14px;
}
.bcdr-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.bcdr-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.bcdr-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
@media (max-width: 800px) {
    .bcdr-grid-4, .bcdr-grid-3 { grid-template-columns: repeat(2,1fr); }
    .bcdr-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
    .bcdr-grid-4, .bcdr-grid-3, .bcdr-grid-2 { grid-template-columns: 1fr; }
}
.bcdr-label {
    display: flex; flex-direction: column; gap: 5px;
    font-size: .82rem; font-weight: 700; color: var(--text-2);
}
.bcdr-label input, .bcdr-label select, .bcdr-label textarea {
    font-size: .88rem; margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   COMPLIANCE
   ═══════════════════════════════════════════════════════════════ */

/* Posture summary row */
.compliance-posture-row {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch;
}
.posture-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 18px; text-align: center; min-width: 90px;
}
.posture-num   { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.posture-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-top: 4px; }
.posture-progress-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 18px; flex: 1; min-width: 200px; display: flex; flex-direction: column; justify-content: center;
}

/* Control family */
.compliance-family-header {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; margin-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.compliance-family-name  { font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.compliance-family-count { font-size: .75rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; color: var(--text-2); }

/* Control cards */
.compliance-control-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 8px; overflow: hidden;
}
.compliance-control-top {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap;
}
.compliance-control-id-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.compliance-control-id {
    font-family: monospace; font-size: .85rem; font-weight: 800;
    color: var(--accent); background: rgba(227,24,55,.08); padding: 2px 8px; border-radius: 4px;
}
.compliance-control-title { flex: 1; font-weight: 600; font-size: .9rem; min-width: 120px; }
.compliance-control-badges { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.compliance-control-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Attestation status badges */
.attest-status-badge {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.status-not_assessed  { background: #f0f0f0; color: #666; }
.status-ai_draft      { background: #dde8f5; color: #1a3a5c; }
.status-under_review  { background: #fff3cd; color: #6b4a0a; }
.status-attested      { background: #d4edda; color: #155724; }
.status-not_applicable{ background: #f0f0f0; color: #888; }
.status-findings      { background: #fde8e8; color: #9b1c1c; }
[data-theme="dark"] .status-not_assessed  { background: #222; color: #888; }
[data-theme="dark"] .status-ai_draft      { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .status-under_review  { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .status-attested      { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .status-findings      { background: #2a0d0d; color: #f08080; }

/* Compliance status (compliant/partial/non_compliant) */
.compliance-status-badge {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: 2px 8px; border-radius: 999px;
}
.cs-compliant     { background: #d4edda; color: #155724; }
.cs-partial       { background: #fff3cd; color: #6b4a0a; }
.cs-non_compliant { background: #fde8e8; color: #9b1c1c; }
.cs-not_applicable{ background: #f0f0f0; color: #888; }
[data-theme="dark"] .cs-compliant     { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .cs-partial       { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .cs-non_compliant { background: #2a0d0d; color: #f08080; }

/* Relevance badge */
.relevance-badge {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 2px 7px; border-radius: 999px;
}
.rel-high   { background: #fde8e8; color: #9b1c1c; }
.rel-medium { background: #fff3cd; color: #6b4a0a; }
.rel-low    { background: #f0f0f0; color: #888; }
[data-theme="dark"] .rel-high   { background: #2a0d0d; color: #f08080; }
[data-theme="dark"] .rel-medium { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .rel-low    { background: #222;    color: #888; }

/* Expandable body */
.compliance-control-body { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.compliance-desc { font-size: .85rem; color: var(--text-2); line-height: 1.6; margin: 12px 0; }

/* AI assessment result area */
.assess-result-area { background: var(--bg-0); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; }
.assess-section { margin-bottom: 12px; }
.assess-section:last-child { margin-bottom: 0; }
.assess-section-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 5px; }
.assess-text { font-size: .86rem; line-height: 1.65; color: var(--text-1); }
.assess-list { padding-left: 16px; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.assess-list li { font-size: .84rem; color: var(--text-1); line-height: 1.5; }
.gaps-list li::marker     { color: var(--accent); }
.evidence-list li::marker { color: var(--success); }

/* Attestation form */
.attest-form { margin-top: 14px; }
.attest-form-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.attest-actions { display: flex; flex-direction: column; min-width: 200px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   RICE SCORE
   ═══════════════════════════════════════════════════════════════ */

.rice-score-badge {
    text-align: center; padding: 12px 20px; border-radius: 10px;
    border: 2px solid transparent; min-width: 90px;
}
.rice-score-num  { font-size: 2rem; font-weight: 900; line-height: 1; }
.rice-score-label{ font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.rice-score-high   { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.rice-score-medium { background: #fff3cd; border-color: #ffeeba; color: #6b4a0a; }
.rice-score-low    { background: #f0f0f0; border-color: #ddd;    color: #555; }
[data-theme="dark"] .rice-score-high   { background: #142a1c; border-color: #1e4029; color: #6fcf8c; }
[data-theme="dark"] .rice-score-medium { background: #2a1e00; border-color: #3a2c00; color: #f0c060; }
[data-theme="dark"] .rice-score-low    { background: #1e1e1e; border-color: #333;    color: #888; }

.rice-grid {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 14px;
}
@media (max-width: 800px) { .rice-grid { grid-template-columns: repeat(2,1fr); } }

.rice-component {
    background: var(--bg-0); border: 1px solid var(--border);
    border-radius: 8px; padding: 14px 16px;
}
.rice-component-label {
    font-size: .7rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--accent); margin-bottom: 6px;
}
.rice-component-value { font-size: 1.4rem; font-weight: 800; color: var(--text-1); line-height: 1.2; }
.rice-bar-track {
    height: 5px; background: var(--bg-2); border-radius: 999px;
    overflow: hidden; margin-top: 10px;
}
.rice-bar-fill {
    height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease;
}
.rice-reasoning {
    font-size: .78rem; color: var(--text-2); line-height: 1.5; margin-top: 8px;
}

.rice-manual-edit { margin-top: 16px; }
.rice-manual-summary {
    cursor: pointer; font-size: .85rem; color: var(--text-2);
    list-style: none; padding: 8px 12px; border-radius: 6px;
    border: 1px dashed var(--border);
}
.rice-manual-summary:hover { color: var(--text-1); border-color: var(--text-2); }
.rice-manual-summary::-webkit-details-marker { display: none; }
.rice-form-grid {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
}
@media (max-width: 700px) { .rice-form-grid { grid-template-columns: repeat(2,1fr); } }
.rice-form-label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; color: var(--text-2); }

/* RICE chip on app list cards */
.rice-score-chip {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.rice-chip-high   { background: #d4edda; color: #155724; }
.rice-chip-medium { background: #fff3cd; color: #6b4a0a; }
.rice-chip-low    { background: #f0f0f0; color: #666; }
[data-theme="dark"] .rice-chip-high   { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .rice-chip-medium { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .rice-chip-low    { background: #1e1e1e; color: #888; }

/* ═══════════════════════════════════════════════════════════════
   AI RESEARCH SECTION
   ═══════════════════════════════════════════════════════════════ */

.research-section {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 22px 24px;
}
.research-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.research-card {
    background: var(--bg-0); border: 1px solid var(--border);
    border-radius: 8px; padding: 16px 18px;
}
.research-card-wide { grid-column: span 2; }
@media (max-width: 700px) { .research-card-wide { grid-column: span 1; } }

.research-card-label {
    font-size: .72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--accent); margin-bottom: 8px;
}
.research-text { font-size: .88rem; line-height: 1.7; color: var(--text-1); }

.complexity-badge {
    display: inline-block; padding: 4px 14px; border-radius: 999px;
    font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.complexity-low       { background: #d4edda; color: #155724; }
.complexity-medium    { background: #fff3cd; color: #6b4a0a; }
.complexity-high      { background: #fde8e8; color: #9b1c1c; }
.complexity-very_high { background: #e31837; color: #fff; }
.complexity-unknown   { background: var(--bg-2); color: var(--text-2); }
[data-theme="dark"] .complexity-low    { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .complexity-medium { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .complexity-high   { background: #2a0d0d; color: #f08080; }

.research-stat { margin-top: 14px; }
.research-stat-num   { display: block; font-size: 1.6rem; font-weight: 800; color: var(--text-1); line-height: 1; }
.research-stat-label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-top: 3px; }

.research-list { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.research-list li { font-size: .85rem; line-height: 1.55; color: var(--text-1); }
.research-steps li::marker { color: var(--accent); font-weight: 700; }
.research-gotchas { list-style: none; padding-left: 0; }
.research-gotchas li::before { content: "⚠ "; color: var(--accent); font-size: .8rem; }

.research-docs-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.research-doc-link {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .85rem; font-weight: 600; padding: 6px 10px;
    border-radius: 5px; border: 1px solid var(--border);
    color: var(--text-1); background: var(--bg-1);
    transition: border-color 120ms, color 120ms;
}
.research-doc-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.research-doc-ext { color: var(--text-2); font-size: .75rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   COMMUNICATIONS
   ═══════════════════════════════════════════════════════════════ */

/* Compose layout */
.compose-wrap {
    display: grid; grid-template-columns: 1fr 360px;
    gap: 20px; align-items: start;
}
@media (max-width: 900px) { .compose-wrap { grid-template-columns: 1fr; } }

.compose-left {
    display: flex; flex-direction: column; gap: 14px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 24px;
}
.compose-field { display: flex; flex-direction: column; gap: 6px; }
.compose-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.compose-actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* AI panel */
.compose-ai { position: sticky; top: 80px; }
.ai-panel {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 22px;
}
.ai-context-card {
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 6px; padding: 12px 14px;
}
.ai-context-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-bottom: 5px; }
.ai-context-body  { font-size: .85rem; line-height: 1.6; color: var(--text-1); }

/* Comms list cards */
.comm-manage-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 18px 20px;
}
.comm-card-draft { border-style: dashed; }
.comm-manage-top { display: flex; gap: 16px; align-items: flex-start; }
.comm-manage-title { font-weight: 700; font-size: 1rem; color: var(--text-1); }
.comm-manage-title:hover { color: var(--accent); text-decoration: none; }
.comm-manage-meta {
    display: flex; gap: 12px; font-size: .78rem; color: var(--text-2);
    margin-top: 4px; flex-wrap: wrap;
}
.comm-manage-preview { font-size: .85rem; color: var(--text-2); line-height: 1.5; margin-top: 8px; }

.comm-status-badge {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: 2px 8px; border-radius: 999px;
}
.draft-badge     { background: #f0f0f0; color: #666; }
.published-badge { background: #d4edda; color: #155724; }
[data-theme="dark"] .draft-badge     { background: #222; color: #888; }
[data-theme="dark"] .published-badge { background: #142a1c; color: #6fcf8c; }

/* Comm view */
.comm-view-wrap { max-width: 720px; }
.comm-view-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 32px 36px;
}
.comm-view-header { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 24px; }
.comm-view-title  { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.comm-view-meta   { font-size: .82rem; color: var(--text-2); }
.comm-view-body p { margin-bottom: 16px; line-height: 1.8; font-size: .95rem; }
.comm-view-body p:last-child { margin-bottom: 0; }

/* ── @mention chip (rendered in existing notes) ────────────────── */
.mention-chip {
    display: inline-block;
    background: #e8f0fe; color: #1a3a8c;
    border-radius: 4px; padding: 0 5px; margin: 0 1px;
    font-weight: 700; font-size: .88em; white-space: nowrap;
}
[data-theme="dark"] .mention-chip { background: #0d1e3a; color: #8ab4d8; }

/* ── @mention autocomplete dropdown ────────────────────────────── */
.mention-dd {
    position: absolute; top: calc(100% + 2px); left: 0;
    z-index: 400; list-style: none; padding: 4px; margin: 0;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.13);
    min-width: 260px; max-height: 220px; overflow-y: auto;
}
.mention-dd-item {
    display: flex; align-items: baseline; gap: 8px;
    padding: 8px 10px; border-radius: 5px; cursor: pointer;
    list-style: none;
}
.mention-dd-item:hover,
.mention-dd-selected { background: var(--bg-2); }
.mention-dd-name  { font-weight: 700; font-size: .88rem; color: var(--text-1); }
.mention-dd-email { font-size: .76rem; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════════════════════ */

.search-page-header { margin-bottom: 28px; }
.search-page-form {
    display: flex; gap: 10px; align-items: center; margin-bottom: 10px;
}
.search-page-input-wrap {
    position: relative; flex: 1; max-width: 560px;
}
.search-page-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 1rem; pointer-events: none; color: var(--text-2);
}
.search-page-input {
    width: 100%; padding: 10px 14px 10px 38px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-1); color: var(--text-1);
    font: inherit; font-size: 1rem;
}
.search-page-input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(227,24,55,.1);
}
.search-summary { font-size: .9rem; color: var(--text-2); }
.search-summary strong { color: var(--text-1); }
.search-summary em { color: var(--accent); font-style: normal; font-weight: 600; }

.search-empty {
    text-align: center; padding: 64px 24px;
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
}

.search-group { margin-bottom: 28px; }
.search-group-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.search-group-label {
    font-size: .75rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-2);
}
.search-group-count {
    background: var(--accent); color: #fff;
    border-radius: 999px; padding: 1px 8px;
    font-size: .72rem; font-weight: 700;
}

.search-result-card {
    display: block; padding: 14px 16px; margin-bottom: 6px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 8px; color: inherit;
    transition: border-color 120ms, box-shadow 120ms;
}
.search-result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(227,24,55,.08);
    text-decoration: none;
}
.search-result-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 5px;
}
.search-result-title { font-weight: 700; font-size: .97rem; color: var(--text-1); }
.search-result-badges { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.search-result-snippet {
    font-size: .85rem; color: var(--text-2); line-height: 1.55;
}
.search-result-snippet mark {
    background: rgba(227,24,55,.12); color: var(--accent);
    font-weight: 700; border-radius: 2px; padding: 0 2px;
}
.search-result-meta { font-size: .75rem; color: var(--text-2); margin-top: 4px; }

/* ── User tracker ──────────────────────────────────────────────── */
.users-table { width:100%; border-collapse:collapse; font-size:.9rem; }
.users-table th { padding:10px 12px; font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-2); border-bottom:2px solid var(--border); }
.users-table td { padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.users-table tr:last-child td { border-bottom:none; }
.users-table tr:hover td { background:var(--bg-2); }

.user-name-link { font-weight:700; color:var(--text-1); }
.user-name-link:hover { color:var(--accent); text-decoration:none; }

.dept-badge {
    display:inline-block; padding:2px 8px; border-radius:4px; font-size:.76rem;
    background:var(--bg-2); color:var(--text-2); border:1px solid var(--border);
    white-space:nowrap;
}

.source-badge {
    display:inline-block; padding:2px 7px; border-radius:999px;
    font-size:.7rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em;
    white-space:nowrap;
}
.source-manual     { background:#f0f0f0; color:#555; }
.source-auto       { background:#dde8f5; color:#1a3a5c; }
.source-log_import { background:#fff3cd; color:#6b4a0a; }
[data-theme="dark"] .source-manual     { background:#222; color:#888; }
[data-theme="dark"] .source-auto       { background:#0d1e2a; color:#8ab4d8; }
[data-theme="dark"] .source-log_import { background:#2a1e00; color:#f0c060; }

/* RICE header badge (inline with status pill) */
.rice-header-badge {
    display: inline-flex; align-items: center;
    padding: 4px 12px; border-radius: 999px;
    font-size: .78rem; font-weight: 800; letter-spacing: .03em;
    border: 2px solid transparent;
}
.rice-score-high-text   { color: var(--success); }
.rice-score-medium-text { color: #e6a817; }
.rice-score-low-text    { color: var(--text-2); }

/* compact RICE strip — between KPI and body */
.rice-strip {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 20px; margin-bottom: 0;
}
.rice-strip-empty { padding: 14px 20px; }
.rice-strip-components {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 700px) { .rice-strip-components { grid-template-columns: repeat(2,1fr); } }
.rice-strip-item  { }
.rice-strip-label { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 3px; }
.rice-strip-val   { font-size: 1.1rem; font-weight: 800; color: var(--text-1); }
.rice-strip-reason{ font-size: .75rem; color: var(--text-2); line-height: 1.4; margin-top: 4px; }

/* 5-column KPI row for app detail */
.app-kpi-row {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
@media (max-width: 1000px) { .app-kpi-row { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 700px)  { .app-kpi-row { grid-template-columns: repeat(2,1fr); } }
.app-kpi-card-rice { border-color: var(--border); }

/* ── File upload zone ──────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border); border-radius: 8px;
    padding: 20px; margin-top: 12px; text-align: center;
    transition: border-color 150ms, background 150ms;
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent); background: #fff5f6;
}
[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone.drag-over { background: #1e0d0d; }
.upload-prompt  { display: flex; align-items: center; justify-content: center; gap: 14px; }
.upload-icon    { font-size: 2rem; }
.upload-text    { text-align: left; font-size: .88rem; line-height: 1.6; }
.queue-item     { font-size: .84rem; color: var(--text-2); padding: 3px 0; text-align: left; }

/* File list */
.file-list  { list-style: none; display: flex; flex-direction: column; gap: 0; }
.file-item  {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.file-item:last-child { border-bottom: none; }
.file-icon  { font-size: 1.2rem; flex-shrink: 0; }
.file-info  { flex: 1; min-width: 0; }
.file-name  { font-size: .88rem; font-weight: 600; color: var(--text-1); word-break: break-all; }
.file-name:hover { color: var(--accent); }
.file-meta  { font-size: .75rem; color: var(--text-2); margin-top: 2px; }
.file-delete-btn {
    color: var(--text-2); border-color: var(--border);
    padding: 4px 8px; font-size: .75rem;
}
.file-delete-btn:hover { color: var(--danger); border-color: var(--danger); }

/* Owner management */
.owners-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.owner-item  {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.owner-item:last-child { border-bottom: none; }
.owner-info  { display: flex; flex-direction: column; gap: 2px; }
.owner-name  { font-weight: 600; font-size: .9rem; }
.owner-email { font-size: .78rem; color: var(--text-2); }

/* Notes */
.note-form textarea {
    width: 100%; margin-top: 12px;
    background: var(--bg-0); border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 12px; font: inherit; font-size: .88rem; color: var(--text-1);
}
.notes-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 0; }
.note-item  { padding: 12px 0; border-bottom: 1px solid var(--border); }
.note-item:last-child { border-bottom: none; }
.note-meta  { display: flex; gap: 12px; align-items: baseline; margin-bottom: 5px; }
.note-author { font-size: .8rem; font-weight: 700; color: var(--text-1); }
.note-date   { font-size: .75rem; color: var(--text-2); }
.note-body   { font-size: .88rem; color: var(--text-2); line-height: 1.6; }
.note-meta   { align-items: center; }
.ai-reply-btn {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: auto;
    padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border);
    background: transparent; color: var(--text-2);
    font-size: .72rem; font-weight: 600; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}
.ai-reply-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ai-reply-btn:disabled { opacity: .5; cursor: not-allowed; }
/* Note delete — margin-left:auto right-aligns it when it's the only action;
   when the reply button is also present (which already has margin-left:auto)
   they sit together at the right edge. */
.note-meta form { margin-left: auto; }
.note-meta .ai-reply-btn + form,
.ai-reply-btn ~ form { margin-left: 4px; }
.note-delete-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
    background: transparent; color: var(--text-2);
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.note-delete-btn:hover { background: var(--danger, #e31837); color: #fff; border-color: var(--danger, #e31837); }
@keyframes _spin { to { transform: rotate(360deg); } }
.spin-icon { animation: _spin .7s linear infinite; }

/* ═══════════════════════════════════════════════════════════════
   MIGRATION DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

.dash-wrap { max-width: 1400px; }

/* Header */
.dash-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 24px; margin-bottom: 28px; flex-wrap: wrap;
}
.dash-title { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.dash-sub   { color: var(--text-2); margin-top: 4px; font-size: .95rem; }

.deadline-badge {
    background: var(--accent); color: #fff; border-radius: 12px;
    padding: 16px 24px; text-align: center; flex-shrink: 0;
    box-shadow: 0 4px 18px rgba(227,24,55,.25);
}
.deadline-badge.deadline-urgent { animation: pulse-red 2s ease-in-out infinite; }
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 4px 18px rgba(227,24,55,.25); }
    50%       { box-shadow: 0 4px 28px rgba(227,24,55,.55); }
}
.deadline-num  { font-size: 2.8rem; font-weight: 900; line-height: 1; }
.deadline-sub  { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.deadline-date { font-size: .82rem; margin-top: 4px; opacity: .9; }

/* KPI Row */
.kpi-row {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 14px; margin-bottom: 24px;
}
@media (max-width: 1100px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .kpi-row { grid-template-columns: repeat(2, 1fr); } }

/* App type badges */
.type-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 5px;
    font-size: .72rem; font-weight: 700; white-space: nowrap;
    text-transform: uppercase; letter-spacing: .04em;
}
.type-saas          { background: #e8f4fd; color: #1a5c8c; border: 1px solid #b8d9f0; }
.type-microsoft365  { background: #e8f0fe; color: #1a3a8c; border: 1px solid #b8c9f0; }
.type-infrastructure{ background: #fde8e8; color: #7a1a1a; border: 1px solid #f0b8b8; }
.type-on_premise    { background: #fff3cd; color: #6b4a0a; border: 1px solid #f0d8a0; }
.type-custom        { background: #f0e8ff; color: #5b21b6; border: 1px solid #d4b8f0; }
[data-theme="dark"] .type-saas          { background: #0d1e2a; color: #8ab4d8; border-color: #152a3a; }
[data-theme="dark"] .type-microsoft365  { background: #0d1430; color: #8ab4f8; border-color: #152040; }
[data-theme="dark"] .type-infrastructure{ background: #2a0d0d; color: #f08080; border-color: #3a1010; }
[data-theme="dark"] .type-on_premise    { background: #2a1e00; color: #f0c060; border-color: #3a2c00; }
[data-theme="dark"] .type-custom        { background: #1e0d3a; color: #c4b5fd; border-color: #2e1a4a; }

/* OIN badges */
.oin-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 700; white-space: nowrap;
    border: 1px solid transparent;
}
.oin-yes     { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.oin-no      { background: #f0f0f0; color: #555;    border-color: #ddd; }
.oin-unknown { background: #f0f0f0; color: #888;    border-color: #ddd; }
[data-theme="dark"] .oin-yes     { background: #142a1c; color: #6fcf8c; border-color: #1e4029; }
[data-theme="dark"] .oin-no      { background: #222;    color: #888;    border-color: #333; }
[data-theme="dark"] .oin-unknown { background: #222;    color: #666;    border-color: #333; }

/* IdP support badges */
.idp-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 700; white-space: nowrap;
    border: 1px solid transparent;
}
.idp-multi        { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.idp-single       { background: #fff3cd; color: #6b4a0a; border-color: #ffeeba; }
.idp-conditional  { background: #dde8f5; color: #1a3a5c; border-color: #c5d8ef; }
.idp-unknown      { background: #f0f0f0; color: #666;    border-color: #ddd; }
[data-theme="dark"] .idp-multi       { background: #142a1c; color: #6fcf8c; border-color: #1e4029; }
[data-theme="dark"] .idp-single      { background: #2a1e00; color: #f0c060; border-color: #3a2c00; }
[data-theme="dark"] .idp-conditional { background: #0d1e2a; color: #8ab4d8; border-color: #152a3a; }
[data-theme="dark"] .idp-unknown     { background: #222;    color: #888;    border-color: #333; }
.kpi-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 20px 22px;
}
.kpi-card-warn { border-color: #f5c6cb; background: #fff8f8; }
[data-theme="dark"] .kpi-card-warn { border-color: #5a1a1a; background: #1e0d0d; }
.kpi-icon { font-size: 1.4rem; margin-bottom: 8px; }
.kpi-num  {
    font-size: 2.2rem; font-weight: 800; line-height: 1;
    color: var(--text-1); letter-spacing: -.03em;
}
.kpi-num-warn { color: var(--accent); }
.kpi-denom { font-size: 1.1rem; font-weight: 500; color: var(--text-2); }
.kpi-label { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 6px 0 10px; }
.kpi-track { height: 5px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.kpi-fill  { height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.kpi-pct   { font-size: .78rem; color: var(--text-2); }

/* Mid row: charts + waves */
.dash-mid {
    display: grid; grid-template-columns: 1fr 1fr 1.3fr;
    gap: 14px; margin-bottom: 24px;
}
@media (max-width: 1100px) { .dash-mid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .dash-mid { grid-template-columns: 1fr; } }

.dash-chart-card,
.dash-waves-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 20px 22px;
}
.dash-chart-card h3,
.dash-waves-card h3 { margin: 2px 0 16px; font-size: 1rem; }

.chart-wrap { display: flex; justify-content: center; margin: 12px 0; }
.chart-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .83rem; color: var(--text-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-migrated    { background: #2e8540; }
.dot-testing     { background: #e6a817; }
.dot-in_progress { background: #4a90d9; }
.dot-not_started { background: #c0c0c0; }
.dot-notified    { background: #4a90d9; }
.dot-pending     { background: #c0c0c0; }
.dot-blocked     { background: #e31837; }

/* Waves */
.waves-list { display: flex; flex-direction: column; gap: 18px; }
.wave-row   { display: flex; flex-direction: column; gap: 5px; }
.wave-meta  { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wave-name  { font-weight: 700; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.wave-dates { font-size: .78rem; color: var(--text-2); }
.wave-stats { display: flex; gap: 14px; font-size: .8rem; color: var(--text-2); }
.wave-progress-track {
    height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden;
}
.wave-progress-fill {
    height: 100%; border-radius: 999px; transition: width .6s ease;
}
.wave-fill-completed { background: #2e8540; }
.wave-fill-active    { background: var(--accent); }
.wave-fill-planned   { background: #4a90d9; }
.wave-pct { font-size: .75rem; color: var(--text-2); text-align: right; }

.wave-badge {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 2px 7px; border-radius: 999px;
}
.wave-completed { background: #d4edda; color: #155724; }
.wave-active    { background: #fde8e8; color: #9b1c1c; }
.wave-planned   { background: #dde8f5; color: #1a3a5c; }
[data-theme="dark"] .wave-completed { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .wave-active    { background: #2a0d0d; color: #f08080; }
[data-theme="dark"] .wave-planned   { background: #0d1e2a; color: #8ab4d8; }

/* Communications full-width row */
.dash-comms-row {
    display: flex; gap: 14px; margin-bottom: 24px;
}
.dash-comms-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

/* Bottom row */
.dash-bottom {
    display: grid; grid-template-columns: 1.6fr 1fr;
    gap: 14px; align-items: start;
}
@media (max-width: 1000px) { .dash-bottom { grid-template-columns: 1fr; } }

.dash-apps-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 20px 22px;
}
.dash-apps-card h3 { margin: 2px 0 14px; font-size: 1rem; }

.apps-table-wrap { overflow-x: auto; max-height: 540px; overflow-y: auto; }
.apps-table { width: 100%; font-size: .875rem; }
.apps-table thead th { position: sticky; top: 0; background: var(--bg-1); z-index: 1; }
.row-blocked td { background: #fff8f8; }
[data-theme="dark"] .row-blocked td { background: #1e0d0d; }
.app-name-cell { font-weight: 600; min-width: 180px; }
.blocker-note  { font-size: .75rem; color: var(--accent); font-weight: 400; margin-top: 3px; }
.wave-label-cell { color: var(--text-2); font-size: .82rem; white-space: nowrap; }
.owner-cell    { color: var(--text-2); font-size: .82rem; white-space: nowrap; }

/* Status pills */
.status-pill {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    white-space: nowrap;
}
.status-migrated    { background: #d4edda; color: #155724; }
.status-testing     { background: #fff3cd; color: #6b4a0a; }
.status-in_progress { background: #dde8f5; color: #1a3a5c; }
.status-not_started { background: #f0f0f0; color: #5a5a5a; }
.status-blocked     { background: #fde8e8; color: #9b1c1c; }
[data-theme="dark"] .status-migrated    { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .status-testing     { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .status-in_progress { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .status-not_started { background: #222; color: #888; }
[data-theme="dark"] .status-blocked     { background: #2a0d0d; color: #f08080; }

/* Right column: milestones + comms */
.dash-right-col { display: flex; flex-direction: column; gap: 14px; }
.dash-section-card {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
    padding: 20px 22px;
}
.dash-section-card h3 { margin: 2px 0 16px; font-size: 1rem; }

/* Milestones */
.milestone-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.milestone-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
    position: relative;
}
.milestone-item:last-child { border-bottom: none; }
.ms-dot {
    width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
    margin-top: 3px;
}
.ms-dot-done { background: #2e8540; }
.ms-dot-open { background: var(--bg-2); border: 2px solid var(--border); }
.ms-body { flex: 1; min-width: 0; }
.ms-label { font-size: .88rem; font-weight: 600; color: var(--text-1); }
.ms-done .ms-label { color: var(--text-2); text-decoration: line-through; }
.ms-date  { font-size: .78rem; color: var(--text-2); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.ms-near  { color: var(--accent); font-weight: 600; }
.ms-check { color: #2e8540; font-weight: 700; }

/* Communications */
.comms-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.comm-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comm-item:last-child { border-bottom: none; }
.comm-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.comm-title  { font-size: .88rem; font-weight: 700; color: var(--text-1); line-height: 1.3; }
.comm-audience {
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 2px 7px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.comm-aud-all        { background: #f0f0f0; color: #5a5a5a; }
.comm-aud-executives { background: #dde8f5; color: #1a3a5c; }
.comm-aud-users      { background: #d4edda; color: #155724; }
.comm-aud-it_team    { background: #fff3cd; color: #6b4a0a; }
[data-theme="dark"] .comm-aud-all        { background: #222; color: #888; }
[data-theme="dark"] .comm-aud-executives { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .comm-aud-users      { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .comm-aud-it_team    { background: #2a1e00; color: #f0c060; }
.comm-body { font-size: .82rem; color: var(--text-2); line-height: 1.5; margin-bottom: 5px; }
.comm-meta { font-size: .75rem; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════
   EXECUTIVE FEATURES — RAG, Risks, Decisions, Timeline, Report
   ═══════════════════════════════════════════════════════════════ */

.exec-wrap {
    max-width: 1200px; margin: 0 auto; padding: 28px 24px;
}

/* ── RAG Status Banner ─────────────────────────────────────────── */
.rag-banner {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; border-radius: 10px; border: 1px solid transparent;
    margin-bottom: 18px; flex-wrap: wrap;
}
.rag-banner.rag-green { background: #eafaf1; border-color: #a3d9b5; color: #155724; }
.rag-banner.rag-amber { background: #fffbeb; border-color: #f6d860; color: #6b4a0a; }
.rag-banner.rag-red   { background: #fef2f2; border-color: #f5c6cb; color: #7f1d1d; }
[data-theme="dark"] .rag-banner.rag-green { background: #0b2015; border-color: #1e4029; color: #6fcf8c; }
[data-theme="dark"] .rag-banner.rag-amber { background: #1e1400; border-color: #3a2c00; color: #f0c060; }
[data-theme="dark"] .rag-banner.rag-red   { background: #1e0a0a; border-color: #4a1212; color: #f0b6b6; }

.rag-dot {
    width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}
.rag-green .rag-dot { background: #2e8540; }
.rag-amber .rag-dot { background: #e6a817; }
.rag-red   .rag-dot { background: #e31837; }

.rag-content  { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rag-label    { font-weight: 700; font-size: .93rem; }
.rag-commentary { font-size: .88rem; opacity: .85; }
.rag-meta     { font-size: .78rem; opacity: .7; flex-shrink: 0; }

/* ── RAG form ──────────────────────────────────────────────────── */
.rag-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row-inline { display: flex; flex-direction: column; gap: 4px; }
.form-row-inline label { font-size: .8rem; font-weight: 600; color: var(--text-2); }

/* ── Executive Hub grid ────────────────────────────────────────── */
.exec-hub-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.exec-hub-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 12px;
    padding: 22px 20px; color: inherit; transition: border-color 150ms, box-shadow 150ms, transform 120ms;
}
.exec-hub-card:hover {
    border-color: var(--accent); text-decoration: none;
    box-shadow: 0 4px 18px rgba(227,24,55,.1); transform: translateY(-2px);
}
.exec-hub-card-accent { border-color: var(--accent); background: #fff8f9; }
[data-theme="dark"] .exec-hub-card-accent { background: #1a0608; }
.exec-hub-icon { font-size: 1.8rem; flex-shrink: 0; }
.exec-hub-body { flex: 1; min-width: 0; }
.exec-hub-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.exec-hub-desc  { font-size: .83rem; color: var(--text-2); line-height: 1.4; }
.exec-hub-arrow { font-size: 1.2rem; color: var(--text-2); flex-shrink: 0; }

/* ── Risk score badges ─────────────────────────────────────────── */
.risk-score-badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: .82rem; font-weight: 800;
}
.risk-score-high { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.risk-score-med  { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.risk-score-low  { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
[data-theme="dark"] .risk-score-high { background: #1e0a0a; color: #f0b6b6; border-color: #4a1212; }
[data-theme="dark"] .risk-score-med  { background: #1e1400; color: #f0c060; border-color: #3a2c00; }
[data-theme="dark"] .risk-score-low  { background: #0b2015; color: #6fcf8c; border-color: #1e4029; }

/* ── Risk category pills ───────────────────────────────────────── */
.risk-cat-pill {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: .75rem; background: var(--bg-2); color: var(--text-2); white-space: nowrap;
}

/* ── Source pills ──────────────────────────────────────────────── */
.source-pill {
    display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .73rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.source-manual { background: #f0f0f0; color: #555; }
.source-auto   { background: #dde8f5; color: #1a3a5c; }
.source-ai     { background: #ede9fe; color: #4c1d95; }
[data-theme="dark"] .source-manual { background: #222; color: #888; }
[data-theme="dark"] .source-auto   { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .source-ai     { background: #1a1028; color: #c4b5fd; }

/* ── Decision type pills ───────────────────────────────────────── */
.dec-type-pill {
    display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700;
}
.dec-type-approval   { background: #d4edda; color: #155724; }
.dec-type-deferral   { background: #fff3cd; color: #6b4a0a; }
.dec-type-escalation { background: #fef2f2; color: #7f1d1d; }
.dec-type-information{ background: #f0f0f0; color: #555; }
[data-theme="dark"] .dec-type-approval   { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .dec-type-deferral   { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .dec-type-escalation { background: #1e0a0a; color: #f0b6b6; }
[data-theme="dark"] .dec-type-information{ background: #222;    color: #888; }

/* Pending row highlight */
.row-pending { background: #fffbeb; }
[data-theme="dark"] .row-pending { background: #1e1400; }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px;
    width: 100%; max-width: 580px; max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.modal-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-weight: 700; font-size: 1rem; }
.modal-close  { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-2); }
.modal-body   { padding: 18px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Gantt / Timeline ──────────────────────────────────────────── */
.gantt-section {
    position: relative; padding: 52px 18px 22px; border-radius: 10px;
    overflow: hidden; min-height: 220px;
}
.gantt-months {
    position: absolute; top: 0; left: 0; right: 0; height: 40px;
    display: flex; align-items: flex-end; pointer-events: none;
}
.gantt-month-tick {
    position: absolute; bottom: 0;
    border-left: 1px solid var(--border); padding-left: 5px;
}
.gantt-month-tick span { font-size: .73rem; color: var(--text-2); }

.gantt-today-line {
    position: absolute; top: 0; bottom: 0;
    width: 2px; background: var(--accent); z-index: 3;
}
.gantt-today-label {
    position: absolute; top: 2px; left: 5px;
    font-size: .7rem; color: var(--accent); font-weight: 700; line-height: 1.2; white-space: nowrap;
}

.gantt-rows { display: flex; flex-direction: column; gap: 16px; }
.gantt-row  { display: flex; align-items: center; gap: 14px; }
.gantt-row-label { width: 120px; flex-shrink: 0; font-size: .82rem; font-weight: 600; color: var(--text-1); text-align: right; }
.gantt-row-track {
    flex: 1; position: relative; height: 28px; background: var(--bg-2);
    border-radius: 4px; border: 1px solid var(--border);
}
.gantt-row-status { width: 90px; flex-shrink: 0; }

.gantt-bar {
    position: absolute; top: 0; height: 100%; border-radius: 4px;
    display: flex; align-items: center; padding: 0 8px; overflow: hidden;
}
.gantt-bar-label { font-size: .72rem; color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-bar-completed { background: #2e8540; }
.gantt-bar-active    { background: var(--accent); }
.gantt-bar-planned   { background: #4a90d9; }
.gantt-bar-delayed   { background: #e6a817; }

/* New grid-based Gantt layout */
.gantt-wrap { background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; overflow-x: auto; }
.gantt-grid { display: grid; grid-template-columns: 200px 1fr 110px; gap: 0; min-width: 700px; }
.gantt-label-col { padding: 6px 10px 6px 0; display: flex; flex-direction: column; justify-content: center; }
.gantt-chart-col { border-left: 1px solid var(--border); padding: 6px 0; min-height: 36px; }
.gantt-status-col { padding: 6px 0 6px 12px; display: flex; align-items: center; }

.gantt-tick { position: absolute; font-size: .72rem; color: var(--text-2); transform: translateX(-50%); top: 6px; }
.gantt-today-label { position: absolute; top: 0; transform: translateX(-50%); font-size: .68rem; color: var(--accent); font-weight: 800; text-align: center; line-height: 1.2; white-space: nowrap; }

/* Wave rows */
.gantt-wave-row { cursor: pointer; border-radius: 6px; transition: background 120ms; }
.gantt-wave-row:hover { background: var(--bg-2); }
.gantt-wave-label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--text-1); }
.gantt-expand-icon { color: var(--text-2); font-size: .75rem; width: 14px; text-align: center; transition: color 120ms; }
.gantt-wave-meta { font-size: .72rem; color: var(--text-2); margin-top: 1px; padding-left: 20px; }

/* App sub-rows */
.gantt-app-row {
    cursor: pointer;
    border-top: 1px solid var(--border);
    transition: background 120ms;
}
.gantt-app-row:hover { background: var(--bg-2); }
.gantt-app-label-col { padding: 4px 10px 4px 24px; }
.gantt-app-name { font-size: .82rem; font-weight: 600; color: var(--text-1); }
.gantt-app-name:hover { color: var(--accent); text-decoration: none; }
.gantt-app-target { font-size: .7rem; color: var(--text-2); margin-left: 6px; }

/* App bars */
.gantt-app-bar {
    position: absolute; top: 50%; transform: translateY(-50%);
    height: 18px; border-radius: 3px; cursor: pointer;
    display: flex; align-items: center; padding: 0 6px; overflow: hidden;
    min-width: 4px; transition: filter 120ms, height 120ms;
}
.gantt-app-bar:hover { filter: brightness(1.1); height: 22px; }
.gantt-app-bar-label { font-size: .68rem; color: rgba(255,255,255,.95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.gantt-app-bar-migrated    { background: #2e8540; }
.gantt-app-bar-testing     { background: #e6a817; }
.gantt-app-bar-in_progress { background: #4a90d9; }
.gantt-app-bar-not_started { background: #b0b0b0; }
.gantt-app-bar-blocked     { background: var(--accent); }

/* Milestones */
.gantt-milestone {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    z-index: 4; cursor: default;
}
.gantt-ms-dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid currentColor;
}
.gantt-ms-done .gantt-ms-dot { background: #2e8540; border-color: #2e8540; color: #2e8540; }
.gantt-ms-open .gantt-ms-dot { background: var(--bg-1); border-color: #4a90d9; color: #4a90d9; }
.gantt-ms-tooltip {
    display: none; position: absolute; bottom: 20px; left: 50%;
    transform: translateX(-50%); background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 10px; font-size: .75rem; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 10; color: var(--text-1);
    pointer-events: none; line-height: 1.5;
}
.gantt-milestone:hover .gantt-ms-tooltip { display: block; }

/* Legend */
.gantt-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: .82rem; color: var(--text-2); padding: 12px 4px; }
.gantt-legend-item { display: flex; align-items: center; gap: 6px; }
.gantt-legend-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

/* Milestones row */
.gantt-milestones-row { display: flex; align-items: flex-start; gap: 14px; margin-top: 12px; }
.gantt-milestone-dot {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 14px; height: 14px; border-radius: 50%;
    z-index: 4; cursor: pointer;
}
.gantt-milestone-dot.ms-dot-done { background: #2e8540; border: 2px solid #2e8540; }
.gantt-milestone-dot.ms-dot-open { background: var(--bg-1); border: 2px solid #4a90d9; }

.gantt-milestone-tip {
    display: none; position: absolute; bottom: 20px; left: 50%;
    transform: translateX(-50%); background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 6px; padding: 6px 10px; font-size: .75rem; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 10; color: var(--text-1);
    pointer-events: none;
}
.gantt-milestone-dot:hover .gantt-milestone-tip { display: block; }

/* ── Executive Report ──────────────────────────────────────────── */
.exec-report {
    max-width: 900px; margin: 0 auto; padding: 28px 24px;
}
.exec-report-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 28px;
}
.report-header {
    text-align: center; margin-bottom: 32px; padding-bottom: 24px;
    border-bottom: 3px solid var(--accent);
}
.report-org   { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.report-title { font-size: 2rem; font-weight: 900; letter-spacing: -.03em; margin: 8px 0 6px; }
.report-meta  { font-size: .85rem; color: var(--text-2); }

.report-section { margin-bottom: 28px; }
.report-kpi-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 12px;
}
@media (max-width: 700px) { .report-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.report-footer {
    text-align: center; padding: 24px 0 8px;
    font-size: .78rem; color: var(--text-2);
    border-top: 1px solid var(--border); margin-top: 32px;
}

/* ── Utility buttons ───────────────────────────────────────────── */
.btn-tiny {
    padding: 3px 9px; font-size: .75rem; border-radius: 5px;
    background: var(--bg-2); border: 1px solid var(--border);
    color: var(--text-1); cursor: pointer; transition: background 100ms;
}
.btn-tiny:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-tiny-danger:hover { background: var(--danger); border-color: var(--danger); }

/* ── Form helpers used in modals ───────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.form-input {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
    font-size: .9rem; background: var(--bg-1); color: var(--text-1);
    transition: border-color 120ms;
}
.form-input:focus { outline: none; border-color: var(--accent); }
textarea.form-input { resize: vertical; }
.form-select {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
    font-size: .9rem; background: var(--bg-1); color: var(--text-1);
}


/* ── LLM model picker (admin settings) ─────────────────────────── */
/* LLM role cards in a two-column grid */
.llm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.llm-model-row {
    display: flex; flex-direction: column; gap: 10px;
    padding: 16px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg-1); transition: border-color 140ms;
}
.llm-model-row:hover { border-color: var(--border-strong, #3a3a3a); }
.llm-model-label-col { display: flex; flex-direction: column; gap: 4px; }
.llm-role-label {
    font-weight: 700; font-size: .92rem; color: var(--text-1);
}
.llm-model-picker-col { display: flex; flex-direction: column; gap: 8px; }
.llm-model-select {
    width: 100%; padding: 8px 12px; font-size: .9rem;
    border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-1); color: var(--text-1);
    cursor: pointer;
}
.llm-model-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227,24,55,.1); }
.llm-custom-input { font-family: monospace; font-size: .88rem; }
.llm-current-val {
    font-size: .75rem; color: var(--text-2);
}
.llm-current-val code {
    background: var(--bg-2); padding: 1px 6px; border-radius: 3px; font-size: .78rem;
}
.settings-source-badge {
    display: inline-block; font-size: .7rem; padding: 1px 7px;
    border-radius: 3px; font-weight: 600; margin-left: 6px; vertical-align: middle;
}
.settings-badge-env     { background: rgba(74,222,128,.12); color: #4ade80; }
.settings-badge-saved   { background: rgba(227,24,55,.1);   color: var(--accent); }
.settings-badge-default { background: var(--bg-2); color: var(--text-2); }

/* ── Integrations settings groups ──────────────────────────────── */
.settings-info-banner {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; border-radius: 8px;
    background: rgba(74,144,217,.08); border: 1px solid rgba(74,144,217,.25);
    font-size: .88rem; line-height: 1.6;
}
.settings-info-banner p { margin: 2px 0 0; color: var(--text-2); }
.settings-banner-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: #4a90d9; }

/* Two-column grid of integration cards — rows align at the top */
.settings-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 18px; align-items: start;
    margin-top: 20px;
}
/* Two-column grid for plain form-field tabs (General) */
.settings-form-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 18px 22px; margin-top: 16px;
}
.settings-form-grid > label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: .9rem; color: var(--text-2);
}
.settings-form-grid > label > small { margin-top: 2px; }
.settings-form-grid .span-2 { grid-column: 1 / -1; }
.settings-group {
    border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; margin: 0;
    background: var(--bg-1);
    transition: border-color 140ms;
}
.settings-group:hover { border-color: var(--border-strong, #3a3a3a); }
.settings-group-header {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 15px 18px; background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}
.settings-group-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; color: var(--text-2); }
.settings-group-title { font-weight: 700; font-size: .98rem; letter-spacing: -.01em; }
.settings-group-desc  { font-size: .81rem; color: var(--text-2); margin-top: 3px; line-height: 1.55; }
.settings-group-desc a { color: var(--accent); }
.settings-group-desc code { font-size: .76rem; background: var(--bg-1); padding: 1px 5px; border-radius: 3px; }

.settings-fields { padding: 4px 0; }

/* Stacked field — label, input, then description. Reads cleanly in a column. */
.settings-field { padding: 12px 18px; border-bottom: 1px solid var(--border); }
.settings-field:last-child { border-bottom: none; }
.settings-field-label  {
    font-size: .82rem; font-weight: 600; margin-bottom: 6px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.settings-field-input  { display: flex; align-items: center; gap: 8px; }
.settings-field-input input { flex: 1; font-size: .86rem; padding: 8px 11px; }
.settings-field-desc   { font-size: .75rem; color: var(--text-2); line-height: 1.5; margin-top: 6px; }
.settings-clear-label  { font-size: .74rem; color: var(--text-2); white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.settings-clear-label input { width: auto; }

/* Setup-instructions disclosure */
.settings-setup { margin-top: 8px; font-size: .8rem; }
.settings-setup > summary {
    cursor: pointer; color: var(--accent); font-weight: 600; font-size: .78rem;
    list-style: none; display: inline-flex; align-items: center; gap: 5px;
}
.settings-setup > summary::-webkit-details-marker { display: none; }
.settings-setup > summary::before { content: '▸'; transition: transform 120ms; display: inline-block; }
.settings-setup[open] > summary::before { transform: rotate(90deg); }
.settings-setup ol { margin: 8px 0 0; padding-left: 18px; line-height: 1.75; }
.settings-setup p  { margin: 8px 0 0; line-height: 1.65; }

/* Inline test-connection result row */
.settings-test-row { margin-top: 4px; padding: 12px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Sticky save bar */
.settings-savebar {
    position: sticky; bottom: 0; z-index: 5;
    margin-top: 4px; padding: 14px 0;
    background: linear-gradient(to top, var(--bg-0, #111) 70%, transparent);
    display: flex; align-items: center; gap: 14px;
}
.settings-savebar .muted { font-size: .78rem; }

.settings-callback-url {
    display: inline-block; font-size: .78rem; font-family: monospace;
    background: var(--bg-1); padding: 2px 8px; border-radius: 4px;
    user-select: all; word-break: break-all;
}
.settings-copy-btn {
    font-size: .72rem; padding: 2px 8px; border: 1px solid var(--border);
    border-radius: 4px; background: transparent; color: var(--text-2);
    cursor: pointer; white-space: nowrap;
}
.settings-copy-btn:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
    .settings-grid { columns: 1; }
    .settings-form-grid { grid-template-columns: 1fr; }
    .llm-grid { grid-template-columns: 1fr; }
}

/* ── Image crop modal ───────────────────────────────────────────── */
.crop-modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.65); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.crop-modal-box {
    background: var(--bg-1); border-radius: 12px;
    width: 100%; max-width: 560px;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
    overflow: hidden;
    max-height: calc(100vh - 40px);
}
.crop-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    font-size: .95rem;
}
.crop-close-btn {
    background: none; border: none; color: var(--text-2);
    font-size: 1.1rem; cursor: pointer; padding: 4px 6px; border-radius: 4px;
}
.crop-close-btn:hover { background: var(--bg-2); color: var(--text-1); }
.crop-canvas-wrap {
    flex: 1; overflow: hidden; background: #111;
    max-height: 400px; min-height: 240px;
}
.crop-canvas-wrap img { display: block; max-width: 100%; }
.crop-modal-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; border-top: 1px solid var(--border); gap: 12px; flex-wrap: wrap;
}
.crop-controls { display: flex; gap: 6px; }

/* hidden attribute must override display:flex on modals */
.crop-modal-overlay[hidden] { display: none; }

/* ── App Security ─────────────────────────────────────────────────────────── */
.sec-item-code {
    font-family: monospace; font-size: .78rem; font-weight: 700;
    padding: 2px 7px; border-radius: 4px; flex-shrink: 0;
}
.sec-code-owasp     { background: #fde8e8; color: #9b1c1c; }
.sec-code-migration { background: #dde8f5; color: #1a3a5c; }

[data-theme="dark"] .sec-code-owasp     { background: #2a0d0d; color: #f08080; }
[data-theme="dark"] .sec-code-migration { background: #0d1e2a; color: #8ab4d8; }

/* Security attestation status badges — mirror attest-status-badge colors */
.sec-status-not_assessed        { background: #f0f0f0; color: #666; }
.sec-status-ai_draft            { background: #dde8f5; color: #1a3a5c; }
.sec-status-compliant           { background: #d4edda; color: #155724; }
.sec-status-partially_compliant { background: #fff3cd; color: #6b4a0a; }
.sec-status-non_compliant       { background: #fde8e8; color: #9b1c1c; }
.sec-status-not_applicable      { background: #f0f0f0; color: #888; }

[data-theme="dark"] .sec-status-not_assessed        { background: #222; color: #888; }
[data-theme="dark"] .sec-status-ai_draft            { background: #0d1e2a; color: #8ab4d8; }
[data-theme="dark"] .sec-status-compliant           { background: #142a1c; color: #6fcf8c; }
[data-theme="dark"] .sec-status-partially_compliant { background: #2a1e00; color: #f0c060; }
[data-theme="dark"] .sec-status-non_compliant       { background: #2a0d0d; color: #f08080; }
[data-theme="dark"] .sec-status-not_applicable      { background: #222;    color: #888; }

/* ── App detail print / PDF export ─────────────────────────────── */
@media print {
    /* Hide site chrome */
    .demo-banner, .topnav-utility, .topnav-main,
    .chat-widget, .app-intel-details,
    .no-print { display:none !important; }

    body { background:#fff !important; color:#000 !important;
           font-size:11pt; line-height:1.5; }

    /* Hide inactive tabs and the tab nav bar */
    .app-tab-nav { display:none !important; }
    .app-tab-content[hidden] { display:none !important; }
    .app-tab-content:not([hidden]) { display:block !important; }

    /* App header — keep name + badges */
    .app-header {
        border:none !important; border-bottom:2pt solid #e31837 !important;
        padding-bottom:10pt !important; margin-bottom:14pt !important;
        background:#fff !important;
    }
    .app-header-name { font-size:20pt !important; }
    .app-header-meta { display:none !important; }

    /* KPI row */
    .app-kpi-row { grid-template-columns:repeat(5,1fr) !important; gap:8pt !important; }
    .app-kpi-card { border:1pt solid #ccc !important; padding:8pt !important; background:#fff !important; }
    .rice-strip  { display:none !important; }

    /* Body panels */
    .app-body { display:block !important; }
    .app-plan-card, .app-notes-card, .dash-section-card,
    .bcdr-section, .compliance-control-card, .gate-card,
    .research-section { break-inside:avoid; }

    /* Step/gate pills inline */
    .step-form, .step-select { display:none !important; }
    .gate-edit-form { display:none !important; }
    .attest-form .attest-actions { display:none !important; }

    /* Colors to print */
    .status-pill, .wave-badge, .type-badge, .idp-badge,
    .oin-badge, .status-pill, .gate-status-badge,
    .attest-status-badge, .compliance-status-badge { -webkit-print-color-adjust:exact; print-color-adjust:exact; }

    /* Page setup */
    @page { margin:1.5cm; size:A4; }
    .page-wrap { padding:0 !important; max-width:100% !important; }
}

/* ── Compliance page print / PDF export ────────────────────────── */
@media print {
    .compliance-control-actions,
    .attest-form .attest-actions,
    .comp-fw-btn,
    .no-print { display:none !important; }

    .compliance-control-body { display:block !important; }
    .compliance-control-card { break-inside:avoid; margin-bottom:8pt; }
    .compliance-family        { break-inside:avoid; }

    .compliance-control-top {
        flex-wrap:wrap; gap:6pt;
    }
    .compliance-posture-row { flex-wrap:wrap; gap:8pt; }
    .posture-card { border:1pt solid #ccc; padding:8pt; }

    .attest-status-badge, .compliance-status-badge,
    .compliance-control-id, .relevance-badge {
        -webkit-print-color-adjust:exact; print-color-adjust:exact;
    }

    /* Section header */
    h1 { font-size:16pt !important; border-bottom:2pt solid #e31837; padding-bottom:6pt; }
    @page { margin:1.5cm; size:A4; }
}

/* ── Tab PDF export bar ─────────────────────────────────────────── */
.tab-pdf-bar {
    display: flex; justify-content: flex-end; margin-bottom: 12px;
}
.tab-pdf-btn {
    font-size: .78rem; padding: 4px 10px; color: var(--text-2);
    border-color: var(--border);
}
.tab-pdf-btn:hover { color: var(--accent); border-color: var(--accent); }
