/* ------ Admin Co-pilot drawer ------ */

/* Floating action button */
.cop-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  height: 48px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: #0A0A0A;
  color: #fff;
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 35;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22), 0 0 0 1px rgba(235,78,45,0.3);
  transition: transform 160ms, box-shadow 200ms, opacity 160ms;
}
.cop-fab:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(0,0,0,0.28), 0 0 0 1px rgba(235,78,45,0.5); }
.cop-fab.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.cop-fab-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--wf-accent); color: #fff; font-size: 14px;
}
.cop-fab-notif {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--wf-accent); color: #fff;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  border: 2px solid #F7F7F8;
}
.cop-fab-ring {
  position: absolute; inset: 2px; border-radius: 999px;
  background: linear-gradient(120deg, rgba(235,78,45,0.0), rgba(235,78,45,0.25), rgba(235,78,45,0.0));
  opacity: 0.5;
  pointer-events: none;
}

/* Drawer */
.cop {
  position: fixed;
  top: 0; right: 0;
  width: 460px;
  height: 100vh;
  background: #0A0A0A;
  color: #E8E8EC;
  border-left: 1px solid #1A1A1A;
  z-index: 34;
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.2,0.7,0.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(0,0,0,0.4);
  font-family: "Montserrat", system-ui, sans-serif;
}
.cop.open { transform: translateX(0); }

/* Header */
.cop-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #1A1A1A;
  background: #050505;
}
.cop-h-title { display: flex; align-items: center; gap: 10px; }
.cop-ava {
  width: 36px; height: 36px; border-radius: 4px;
  background: linear-gradient(135deg, var(--wf-accent), #8A5CF6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.cop-name {
  font-family: "Bebas Neue", sans-serif;
  font-size: 20px; letter-spacing: 0.04em; text-transform: uppercase;
}
.cop-name-sub { color: #8A8A92; font-size: 11px; font-family: "Montserrat"; text-transform: none; letter-spacing: 0; font-weight: 500; }
.cop-stat { font-size: 10.5px; color: #8A8A92; letter-spacing: 0.1em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.cop-stat .dot { width: 6px; height: 6px; border-radius: 50%; background: #2FBF5A; box-shadow: 0 0 0 3px rgba(47,191,90,0.2); }
.cop-close {
  background: transparent; border: 0; color: #8A8A92; font-size: 16px;
  width: 28px; height: 28px; border-radius: 4px; cursor: pointer;
}
.cop-close:hover { background: #1A1A1A; color: #fff; }

/* Context chips */
.cop-ctx {
  padding: 10px 14px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid #1A1A1A;
  background: #080808;
}
.cop-ctx-lbl {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: #6A6A72; margin-right: 4px;
}
.cop-chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 999px;
  background: #1A1A1A; color: #E8E8EC; border: 1px solid #222;
}
.cop-chip.role { background: rgba(235,78,45,0.18); color: var(--wf-accent); border-color: rgba(235,78,45,0.4); }
.cop-chip.ghost { background: transparent; color: #6A6A72; border-style: dashed; cursor: pointer; }

/* Tabs */
.cop-tabs {
  display: flex;
  border-bottom: 1px solid #1A1A1A;
  background: #080808;
}
.cop-tab {
  flex: 1;
  padding: 10px 12px;
  border: 0; background: transparent;
  color: #6A6A72;
  font-family: inherit;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 120ms, border-color 120ms;
}
.cop-tab:hover { color: #E8E8EC; }
.cop-tab.active { color: #fff; border-bottom-color: var(--wf-accent); }

.cop-tabpane { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.cop-tabpane.active { display: flex; }

/* Body / thread */
.cop-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cop-body::-webkit-scrollbar { width: 6px; }
.cop-body::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }

.cop-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.cop-msg.a { align-self: flex-start; max-width: 92%; }
.cop-msg.u { align-self: flex-end; flex-direction: row-reverse; max-width: 85%; }
.cop-ava-sm {
  width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.cop-ava-sm.a { background: linear-gradient(135deg, var(--wf-accent), #8A5CF6); color: #fff; }
.cop-ava-sm.u { background: #1A1A1A; color: #E8E8EC; border: 1px solid #222; }
.cop-bub {
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.55;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.cop-msg.a .cop-bub { background: #111; border: 1px solid #1A1A1A; color: #E8E8EC; }
.cop-msg.u .cop-bub { background: var(--wf-accent); color: #fff; }
.cop-bub b { font-weight: 700; color: #fff; }
.cop-bub ul { color: #BFBFC6; }
.cop-src {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #222;
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: #6A6A72;
  letter-spacing: 0.02em;
}
.cop-policy {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 8px; padding: 8px 10px;
  background: rgba(200,24,36,0.08);
  border: 1px solid rgba(200,24,36,0.25);
  border-radius: 4px;
  font-size: 11px; color: #DDB;
  line-height: 1.5;
}
.cop-policy-pill {
  flex-shrink: 0;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  background: #C81824; color: #fff; padding: 2px 7px; border-radius: 999px;
}

.cop-suggest-label {
  display: block;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: #8A8A92; margin-bottom: 2px;
}
.cop-suggest { display: flex; flex-direction: column; gap: 8px; padding-left: 34px; }
.cop-sugg-card {
  background: #111;
  border: 1px solid #1A1A1A;
  border-left: 2px solid var(--wf-accent);
  border-radius: 4px;
  padding: 10px 12px;
}
.cop-sugg-card:nth-child(2) { border-left-color: #B36A00; }
.cop-sugg-card:nth-child(3) { border-left-color: #1F4C8A; }
.cop-sugg-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--wf-accent); margin-bottom: 4px;
}
.cop-sugg-tag.warn { color: #E5A145; }
.cop-sugg-tag.info { color: #6FA8EF; }
.cop-sugg-t { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.cop-sugg-s { font-size: 11.5px; color: #BFBFC6; line-height: 1.45; }
.cop-sugg-act { display: flex; gap: 6px; margin-top: 8px; }
.cop-a {
  font-family: inherit;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 4px;
  background: #E8E8EC; color: #0A0A0A; border: 0; cursor: pointer;
}
.cop-a.ghost { background: transparent; color: #8A8A92; border: 1px solid #222; }
.cop-a:hover { filter: brightness(0.95); }

/* Orchestration card */
.cop-orchestrate {
  border: 1px solid #1A1A1A;
  background: #080808;
  border-radius: 4px;
  padding: 10px 12px;
  margin-left: 34px;
}
.cop-orch-h {
  font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: #8A8A92; margin-bottom: 8px;
}
.cop-orch-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 6px 0;
  border-top: 1px solid #1A1A1A;
}
.cop-orch-row:first-of-type { border-top: 0; }
.cop-orch-agent {
  color: #fff; font-family: "Bebas Neue"; font-size: 11px; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 3px; flex-shrink: 0;
}
.cop-orch-body { flex: 1; min-width: 0; }
.cop-orch-action { font-size: 12px; color: #E8E8EC; margin-bottom: 2px; }
.cop-orch-meta { font-size: 10.5px; color: #6A6A72; display: flex; align-items: center; gap: 6px; font-family: ui-monospace, monospace; }
.cop-orch-dot { width: 7px; height: 7px; border-radius: 50%; background: #6A6A72; }
.cop-orch-dot.ok { background: #2FBF5A; }
.cop-orch-dot.pulse {
  background: var(--wf-accent);
  animation: copPulse 1.2s infinite;
}
@keyframes copPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(235,78,45,0.6); }
  50% { box-shadow: 0 0 0 5px rgba(235,78,45,0); }
}

/* Quick-chips + composer */
.cop-quicks {
  display: flex; gap: 6px; padding: 8px 14px 0;
  overflow-x: auto;
  border-top: 1px solid #1A1A1A;
  background: #080808;
}
.cop-quicks::-webkit-scrollbar { height: 4px; }
.cop-quicks::-webkit-scrollbar-thumb { background: #222; }
.cop-q {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 10.5px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px;
  background: #111; color: #E8E8EC;
  border: 1px solid #1A1A1A;
  cursor: pointer;
  white-space: nowrap;
}
.cop-q:hover { border-color: var(--wf-accent); color: #fff; }

.cop-composer {
  padding: 10px 14px 14px;
  background: #080808;
}
.cop-compose-row {
  display: flex; align-items: flex-end; gap: 8px;
  background: #111;
  border: 1px solid #1A1A1A;
  border-radius: 4px;
  padding: 6px 6px 6px 10px;
  transition: border-color 120ms;
}
.cop-compose-row:focus-within { border-color: var(--wf-accent); }
.cop-compose-row textarea {
  flex: 1;
  border: 0; outline: none;
  background: transparent;
  color: #E8E8EC;
  font-family: inherit;
  font-size: 12.5px;
  resize: none;
  padding: 6px 0;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
}
.cop-compose-row textarea::placeholder { color: #5A5A62; }
.cop-compose-actions { display: flex; gap: 4px; }
.cop-attach, .cop-send {
  width: 30px; height: 30px;
  border: 0; border-radius: 4px; cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.cop-attach { background: #1A1A1A; color: #8A8A92; }
.cop-attach:hover { color: #fff; }
.cop-send { background: var(--wf-accent); color: #fff; font-weight: 800; }
.cop-send:hover { filter: brightness(0.95); }

.cop-foot {
  display: flex; justify-content: space-between;
  font-size: 10px; color: #5A5A62;
  margin-top: 6px;
  letter-spacing: 0.04em;
  font-family: ui-monospace, monospace;
}
.cop-foot .hl { color: var(--wf-accent); font-weight: 700; }

/* --- Agents tab --- */
.cop-agent-grid {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex-shrink: 0;
}
.cop-agent {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: #111;
  border: 1px solid #1A1A1A;
  border-radius: 4px;
}
.cop-agent .badge {
  color: #fff; font-family: "Bebas Neue"; font-size: 12px; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 3px; min-width: 46px; text-align: center;
}
.cop-agent .n { font-size: 12.5px; font-weight: 700; color: #fff; }
.cop-agent .m { font-size: 10.5px; color: #6A6A72; font-family: ui-monospace, monospace; }
.cop-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-left: auto; flex-shrink: 0;
}
.cop-dot.ok { background: #2FBF5A; }
.cop-dot.warn { background: #E5A145; }
.cop-dot.err { background: #C81824; }

.cop-sub-h {
  padding: 12px 14px 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase;
  color: #6A6A72;
}

.cop-chatter {
  padding: 0 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.cop-chat-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px;
  background: #111;
  border: 1px solid #1A1A1A;
  border-radius: 4px;
}
.cop-chat-agent {
  color: #fff; font-family: "Bebas Neue"; font-size: 11px; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 3px; flex-shrink: 0;
}
.cop-chat-body { flex: 1; font-size: 11.5px; color: #BFBFC6; line-height: 1.45; min-width: 0; }
.cop-chat-body b { color: #E8E8EC; font-weight: 700; }
.cop-chat-time { font-size: 10px; color: #5A5A62; font-family: ui-monospace, monospace; flex-shrink: 0; }

.cop-cmd {
  padding: 6px 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11.5px;
  color: #BFBFC6;
}
.cop-cmd > div {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 10px;
  background: #111;
  border: 1px solid #1A1A1A;
  border-radius: 4px;
}
.cop-cmd-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--wf-accent); background: rgba(235,78,45,0.1); padding: 2px 6px; border-radius: 3px;
}
.cop-cmd .mono { font-family: ui-monospace, monospace; font-size: 11px; color: #E8E8EC; }

/* --- Learning tab --- */
.cop-tabpane[data-pane="learning"] { overflow-y: auto; }
.cop-learn-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px;
}
.cop-learn-hero > div {
  background: #111; border: 1px solid #1A1A1A; border-radius: 4px;
  padding: 12px;
}
.cop-learn-k {
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: #6A6A72;
}
.cop-learn-v {
  font-family: "Bebas Neue"; font-size: 32px; letter-spacing: 0.02em;
  color: #fff; line-height: 1; margin-top: 6px;
}
.cop-learn-sub { font-family: "Montserrat"; font-size: 11px; color: #6A6A72; font-weight: 500; letter-spacing: 0; }

.cop-src-list {
  padding: 0 14px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.cop-src-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #111;
  border: 1px solid #1A1A1A;
  border-radius: 4px;
}
.cop-src-icon {
  width: 28px; height: 28px; border-radius: 4px;
  background: #1A1A1A; color: var(--wf-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.cop-src-body { flex: 1; min-width: 0; }
.cop-src-t { font-size: 12px; font-weight: 700; color: #fff; font-family: ui-monospace, monospace; }
.cop-src-m { font-size: 10.5px; color: #6A6A72; margin-top: 2px; }
.cop-src-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 7px; border-radius: 3px; flex-shrink: 0;
}
.cop-src-tag.ok { background: rgba(47,191,90,0.12); color: #2FBF5A; }
.cop-src-tag.warn { background: rgba(229,161,69,0.12); color: #E5A145; }
.cop-add-src {
  margin-top: 4px;
  background: transparent;
  border: 1px dashed #222;
  color: #8A8A92;
  font-family: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}
.cop-add-src:hover { border-color: var(--wf-accent); color: #fff; }

.cop-learn-feed {
  padding: 0 14px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.cop-learn-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  background: #111;
  border: 1px solid #1A1A1A;
  border-radius: 4px;
}
.cop-learn-agent {
  color: #fff; font-family: "Bebas Neue"; font-size: 11px; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 3px; flex-shrink: 0;
}
.cop-learn-t { font-size: 12px; font-weight: 700; color: #fff; }
.cop-learn-m { font-size: 10.5px; color: #6A6A72; margin-top: 3px; line-height: 1.4; }
.cop-learn-time { font-size: 10px; color: #5A5A62; font-family: ui-monospace, monospace; flex-shrink: 0; }

@media (max-width: 540px) {
  .cop { width: 100%; }
}
