/* ═══════════════════════════════════════════════════════════════════════
   Risos AI — Agent System (Stage 7)
   Co-Pilot widget · Feed Panel · Inbox · Integrity Badge · Settings Modal
   ═══════════════════════════════════════════════════════════════════════
*/

:root {
  --agent-radius:      12px;
  --agent-radius-sm:   8px;
  --agent-radius-pill: 999px;
  --agent-z-panel:     250;
  --agent-z-modal:     260;
  --agent-shadow:      0 6px 30px rgba(0, 0, 0, 0.18);

  --agent-sev-critical:    #ef4444;
  --agent-sev-warning:     #f59e0b;
  --agent-sev-info:        #3b82f6;
  --agent-sev-suggestion:  #06B6D4;
  --agent-sev-celebration: #10b981;
}

/* ═══════════════════════════════════════════════════════════════════════
   1. Co-Pilot Navbar Widget
   ═══════════════════════════════════════════════════════════════════════ */

.copilot-nav-widget {
  display: inline-flex;
  align-items: center;
}

.copilot-feed-btn {
  position: relative;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #f1f5f9);
  width: 36px;
  height: 36px;
  border-radius: var(--agent-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
  padding: 0;
  font-size: 16px;
}

.copilot-feed-btn:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
  transform: translateY(-1px);
}

.copilot-feed-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
}

.copilot-status-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--agent-sev-celebration);
  box-shadow: 0 0 0 2px var(--bg-surface, #1e293b);
  animation: copilot-pulse 2.5s ease-in-out infinite;
}

.copilot-status-dot--inline {
  position: static;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
  box-shadow: none;
}

.copilot-status-dot.paused { background: var(--agent-sev-warning); animation: none; }
.copilot-status-dot.disabled { background: #64748b; animation: none; }

@keyframes copilot-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--bg-surface, #1e293b), 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50%      { box-shadow: 0 0 0 2px var(--bg-surface, #1e293b), 0 0 0 6px rgba(16, 185, 129, 0); }
}

.copilot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--agent-sev-critical);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-surface, #1e293b);
}

/* Light theme overrides */
body.theme-light .copilot-status-dot { box-shadow: 0 0 0 2px #fff; }
body.theme-light .copilot-badge      { box-shadow: 0 0 0 2px #fff; }

/* ═══════════════════════════════════════════════════════════════════════
   2. Agent Feed Slide-in Panel
   ═══════════════════════════════════════════════════════════════════════ */

.agent-feed-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 92vw;
  /* SOLID background — bukan --bg-surface yang transparan di dark mode */
  background: #14141f;
  border-left: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  z-index: var(--agent-z-panel);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.24, 1);
  box-shadow: var(--agent-shadow);
  font-family: 'DM Sans', system-ui, sans-serif;
}

.agent-feed-panel.is-open {
  transform: translateX(0);
}

/* Light theme override — solid putih */
body.theme-light .agent-feed-panel {
  background: var(--surface-2, #ffffff);
  border-left-color: rgba(15, 23, 42, 0.10);
}

/* Header */
.afp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  flex-shrink: 0;
}

.afp-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.afp-title-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.afp-status-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

.afp-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--agent-sev-celebration);
}

.afp-status-dot.paused   { background: var(--agent-sev-warning); }
.afp-status-dot.disabled { background: #64748b; }

.afp-actions {
  display: flex;
  gap: 4px;
}

.afp-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.afp-btn:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
  color: var(--text-primary);
}

/* Integrity bar */
.afp-integrity-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  flex-shrink: 0;
}

.afp-integrity-label {
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.afp-integrity-progress {
  flex: 1;
  height: 5px;
  background: var(--border-default, rgba(255, 255, 255, 0.08));
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.afp-integrity-fill {
  height: 100%;
  width: 0%;
  background: var(--agent-sev-celebration);
  border-radius: 3px;
  transition: width 0.5s ease, background-color 0.3s ease;
}

.afp-integrity-fill.low    { background: var(--agent-sev-critical); }
.afp-integrity-fill.medium { background: var(--agent-sev-warning); }
.afp-integrity-fill.high   { background: var(--agent-sev-celebration); }

.afp-integrity-score {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 36px;
  text-align: right;
}

/* Filter Tabs */
.afp-filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.afp-filter-tabs::-webkit-scrollbar { display: none; }

.afp-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--agent-radius-pill);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: background 0.12s, color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.afp-tab:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
  color: var(--text-primary);
}

.afp-tab.active {
  background: var(--color-primary, #3B82F6);
  color: #fff;
}

.afp-inbox-badge {
  background: var(--agent-sev-critical);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Feed list */
.afp-feed-list,
.afp-inbox-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}

.afp-feed-list::-webkit-scrollbar,
.afp-inbox-list::-webkit-scrollbar {
  width: 6px;
}

.afp-feed-list::-webkit-scrollbar-thumb,
.afp-inbox-list::-webkit-scrollbar-thumb {
  background: var(--border-default, rgba(255, 255, 255, 0.08));
  border-radius: 3px;
}

/* Empty state */
.afp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
}

.afp-empty-emoji {
  font-size: 32px;
  opacity: 0.5;
}

.afp-empty-text {
  font-size: 12px;
}

/* Feed item card */
.afp-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
  transition: background 0.12s ease;
  cursor: pointer;
}

.afp-item:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.03));
}

.afp-item[data-status="read"]   { opacity: 0.65; }
.afp-item[data-status="acted"]  { opacity: 0.5; }

.afp-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.afp-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.afp-item-dot.severity-critical    { background: var(--agent-sev-critical); }
.afp-item-dot.severity-warning     { background: var(--agent-sev-warning); }
.afp-item-dot.severity-info        { background: var(--agent-sev-info); }
.afp-item-dot.severity-suggestion  { background: var(--agent-sev-suggestion); }
.afp-item-dot.severity-celebration { background: var(--agent-sev-celebration); }

.afp-item-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  color: var(--text-muted);
}

.afp-item-stage {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.afp-item-time {
  opacity: 0.7;
}

.afp-item-snooze {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  border-radius: 4px;
}

.afp-item-snooze:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
  color: var(--text-primary);
}

.afp-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.35;
}

.afp-item-msg {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.afp-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.afp-action-btn {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--agent-radius-sm);
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  transition: background 0.12s, border-color 0.12s;
}
a.afp-action-btn { color: var(--text-primary); }
a.afp-action-btn:visited { color: var(--text-primary); }

.afp-action-btn:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
  border-color: var(--border-strong, rgba(255, 255, 255, 0.18));
}

.afp-action-btn.primary {
  background: var(--color-primary, #3B82F6);
  border-color: transparent;
  color: #fff;
}

.afp-action-btn.primary:hover {
  background: var(--color-primary-hover, #60A5FA);
}

.afp-action-dismiss {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 4px;
}

.afp-action-dismiss:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
}

/* Inbox item card */
.afp-inbox-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
}

.afp-inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.afp-inbox-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--agent-radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-draft_ready          { background: rgba(59, 130, 246, 0.15);  color: #60A5FA; }
.type-literature_alert     { background: rgba(245, 158, 11, 0.15);  color: #fbbf24; }
.type-analysis_finding     { background: rgba(239, 68, 68, 0.15);   color: #f87171; }
.type-journal_matches      { background: rgba(59, 130, 246, 0.15);  color: #60a5fa; }
.type-coherence_issue      { background: rgba(245, 158, 11, 0.15);  color: #fbbf24; }
.type-response_letter_ready { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.afp-inbox-time {
  font-size: 10px;
  color: var(--text-muted);
}

.afp-inbox-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.afp-inbox-summary {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.afp-inbox-preview {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
  border-radius: var(--agent-radius-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

.afp-inbox-affected {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.afp-affected-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--agent-radius-pill);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.afp-affected-chip a {
  color: var(--text-secondary);
  text-decoration: none;
}

.afp-affected-chip a:hover {
  color: var(--color-primary);
}

.afp-inbox-actions {
  display: flex;
  gap: 6px;
}

.afp-inbox-btn {
  flex: 1;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--agent-radius-sm);
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.afp-inbox-btn.primary {
  background: var(--color-primary, #3B82F6);
  border-color: transparent;
  color: #fff;
}

.afp-inbox-btn.secondary {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.04));
}

.afp-inbox-btn.reject {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.afp-inbox-btn:hover {
  filter: brightness(1.1);
}

/* Overnight task input */
.afp-overnight {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  flex-shrink: 0;
}

.afp-overnight-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.afp-overnight-input {
  width: 100%;
  background: var(--bg-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  border-radius: var(--agent-radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-primary);
  resize: none;
  font-family: inherit;
}

.afp-overnight-input:focus {
  outline: 0;
  border-color: var(--color-primary, #3B82F6);
}

.afp-overnight-btn {
  width: 100%;
  margin-top: 6px;
  padding: 7px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--agent-radius-sm);
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.afp-overnight-btn:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
  border-color: var(--color-primary, #3B82F6);
}

/* Auto-Pilot toggle row */
.afp-autopilot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
}

.afp-autopilot-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.afp-autopilot-label > span:first-child {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.afp-autopilot-status {
  font-size: 10px;
  color: var(--text-muted);
}

.afp-autopilot-status.active   { color: var(--agent-sev-celebration); }
.afp-autopilot-status.running  { color: var(--agent-sev-info); }
.afp-autopilot-status.waiting  { color: var(--agent-sev-warning); }

/* Toggle switch */
.afp-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.afp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.afp-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong, rgba(255, 255, 255, 0.18));
  border-radius: var(--agent-radius-pill);
  cursor: pointer;
  transition: background 0.2s;
}

.afp-toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.afp-toggle input:checked + .afp-toggle-slider {
  background: var(--color-primary, #3B82F6);
}

.afp-toggle input:checked + .afp-toggle-slider::before {
  transform: translateX(16px);
}

/* ═══════════════════════════════════════════════════════════════════════
   3. Stage Integrity Badge (per-page mini)
   ═══════════════════════════════════════════════════════════════════════ */

.stage-integrity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--agent-radius-pill);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  cursor: pointer;
  font-size: 11px;
  color: var(--text-primary);
  transition: background 0.12s;
}

.stage-integrity-badge:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
}

.sib-icon { font-size: 12px; }

.sib-bar-wrap {
  width: 50px;
  height: 4px;
  background: var(--border-default, rgba(255, 255, 255, 0.08));
  border-radius: 3px;
  overflow: hidden;
}

.sib-bar {
  height: 100%;
  background: var(--agent-sev-celebration);
  transition: width 0.5s ease, background-color 0.3s;
}

.sib-bar.low    { background: var(--agent-sev-critical); }
.sib-bar.medium { background: var(--agent-sev-warning); }

.sib-score { font-weight: 600; font-size: 10.5px; }

.sib-issues {
  font-size: 10px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   4. Settings Modal
   ═══════════════════════════════════════════════════════════════════════ */

.agent-settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--agent-z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.agent-settings-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.agent-settings-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  /* SOLID background — same fix sebagai panel */
  background: #14141f;
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  border-radius: var(--agent-radius);
  width: 460px;
  max-width: 92vw;
  max-height: 85vh;
  z-index: calc(var(--agent-z-modal) + 1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  color: var(--text-primary, #f1f5f9);
}

.agent-settings-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

body.theme-light .agent-settings-modal {
  background: var(--surface-2, #ffffff);
  color: var(--text-primary, #0f172a);
  border-color: rgba(15, 23, 42, 0.10);
}

.asm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.asm-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.asm-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
}

.asm-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
}

.asm-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.asm-section {
  margin: 14px 0 8px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.asm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.04));
}

.asm-row:last-child { border-bottom: 0; }

.asm-label {
  font-size: 12.5px;
  color: var(--text-primary);
}

.asm-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.asm-select,
.asm-input {
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-default, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 11.5px;
  color: var(--text-primary);
  min-width: 130px;
}

.asm-level-toggle {
  display: inline-flex;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.asm-level-toggle button {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 500;
}

.asm-level-toggle button.active {
  background: var(--color-primary, #3B82F6);
  color: #fff;
}

.asm-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.asm-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.asm-save-btn {
  background: var(--color-primary, #3B82F6);
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: var(--agent-radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.asm-save-btn:hover {
  background: var(--color-primary-hover, #60A5FA);
}

/* Auto-Pilot section dalam settings */
.asm-autopilot-tasks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 6px;
}

.asm-task-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
}

.asm-task-checkbox:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.05));
}

/* ═══════════════════════════════════════════════════════════════════════
   5. Mobile responsive
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .agent-feed-panel {
    width: 100%;
    max-width: 100%;
    border-left: 0;
  }

  .stage-integrity-badge .sib-bar-wrap { width: 36px; }

  .agent-settings-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }

  .agent-settings-modal.is-open {
    transform: none;
  }
}

/* Prevent body scroll when panel open on mobile */
body.agent-feed-open {
  overflow: hidden;
}

@media (min-width: 641px) {
  body.agent-feed-open {
    overflow: auto; /* desktop tetap bisa scroll */
  }
}
