/* ── Digital Assistant Slide-Over Panel ─────────────────────────────── */

.assistant-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32, 37, 50, 0.38);
    z-index: 300;
    display: flex;
    justify-content: flex-end;
}

.assistant-slide {
    position: relative;
    height: 100vh;
    width: 460px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    border-radius: 22px 0 0 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.97) 0%, rgba(248,250,252,0.96) 100%);
    box-shadow: -4px 0 32px rgba(0,0,0,0.18);
    animation: assistant-slide-in 240ms ease forwards;
    overflow: hidden;
}

@keyframes assistant-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.assistant-panel-header {
    flex-shrink: 0;
    padding: 18px 20px 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
}

.assistant-panel-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.assistant-panel-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 2px;
}

.assistant-close-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.assistant-close-btn:hover {
    background: rgba(255,255,255,0.28);
}

.assistant-tab-bar {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: #f8fafc;
}

.assistant-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-soft, #64748b);
    transition: all 0.15s;
}

.assistant-tab:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.assistant-tab.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.assistant-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    color: inherit;
}

.assistant-tab.active .assistant-badge {
    background: rgba(255,255,255,0.3);
}

.assistant-tab-content {
    overflow-y: auto;
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-card {
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    padding: 14px;
    transition: box-shadow 0.15s;
}

.assistant-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.assistant-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.assistant-card-description {
    font-size: 0.8rem;
    color: var(--text-soft, #64748b);
    margin: 0 0 8px 0;
    line-height: 1.45;
}

.assistant-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.assistant-card-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.assistant-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.assistant-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    background: transparent;
}

.assistant-action-btn.accept {
    background: #dcfce7;
    color: #16a34a;
}
.assistant-action-btn.accept:hover {
    background: #16a34a;
    color: #fff;
}

.assistant-action-btn.edit {
    background: #e0f2fe;
    color: #0369a1;
}
.assistant-action-btn.edit:hover {
    background: #0369a1;
    color: #fff;
}

.assistant-action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}
.assistant-action-btn.delete:hover {
    background: #dc2626;
    color: #fff;
}

.assistant-source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    margin-left: auto;
}

.assistant-inline-edit {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assistant-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.assistant-edit-row.full {
    grid-template-columns: 1fr;
}

.assistant-edit-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.assistant-edit-field label {
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--text-soft, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.assistant-edit-field input,
.assistant-edit-field select,
.assistant-edit-field textarea {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.83rem;
    color: #1e293b;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.assistant-edit-field input:focus,
.assistant-edit-field select:focus,
.assistant-edit-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}

.assistant-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.assistant-edit-save {
    padding: 6px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.assistant-edit-save:hover {
    background: #1d4ed8;
}

.assistant-edit-cancel {
    padding: 6px 14px;
    background: transparent;
    color: var(--text-soft, #64748b);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 7px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.assistant-edit-cancel:hover {
    background: #f1f5f9;
}

.assistant-empty-state {
    text-align: center;
    color: var(--text-soft, #94a3b8);
    padding: 48px 16px;
    font-size: 0.9rem;
}

.assistant-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

/* ── Assistant trigger button in topbar / AP toolbar ─────────────────── */

.assistant-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    transition: all 0.18s;
    white-space: nowrap;
}

.assistant-trigger-btn:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
    box-shadow: 0 4px 14px rgba(37,99,235,0.38);
    transform: translateY(-1px);
}

.assistant-topbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 2px;
    box-shadow: 0 1px 4px rgba(239,68,68,0.45);
}

/* AP count badge on the button */
.assistant-btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* Risk score badge for risk cards */
.assistant-risk-score {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

.assistant-risk-score.high   { background: #fee2e2; color: #dc2626; }
.assistant-risk-score.medium { background: #fef3c7; color: #d97706; }
.assistant-risk-score.low    { background: #dcfce7; color: #16a34a; }
