:root {
  --bg: #000000;
  --bg-secondary: #050505;
  --bg-tertiary: #080808;
  --surface: #0a0a0a;
  --surface2: #050505;
  --text: #ffffff;
  --text-dim: #888888;
  --text-muted: #555555;
  --accent: #ff3333;
  --success: #00ff41;
  --border: rgba(255, 255, 255, 0.1);
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-6: 24px;
}

body {
  background: #000000 !important;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.board-wrap {
  overflow-x: auto;
  padding: var(--gap-4) ;
  scrollbar-width: thin;
  height: calc(100vh - 200px);
  display: flex;
}

.board {
  display: flex;
  flex-direction: row !important;
  gap: var(--gap-4);
  align-items: flex-start;
  padding-bottom: var(--gap-4);
  height: 100%;
}

/* Column Styles - Only Headers Colored */
.column[data-status] { 
  background: transparent; 
  border: 1px solid rgba(255, 255, 255, 0.05); 
}

.column[data-status="Backlog"] .col-header { border-top: 4px solid #666; background: #333 !important; }
.column[data-status="Investigando"] .col-header { border-top: 4px solid #3b82f6; background: rgba(59, 130, 246, 0.15); }
.column[data-status="En Proceso"] .col-header { border-top: 4px solid #ff4444; background: rgba(255, 68, 68, 0.3) !important; box-shadow: 0 0 15px rgba(255, 68, 68, 0.2); }
.column[data-status="En Revision"] .col-header { border-top: 4px solid #e9c46a; background: rgba(233, 196, 106, 0.15); }
.column[data-status="Completado"] .col-header { border-top: 4px solid #10b981; background: rgba(16, 185, 129, 0.15); }


/* DRAWER (Jira Style Issue View) */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9); /* Reduced transparency */
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(12px); /* Increased blur */
}

.drawer-backdrop.active {
  display: flex;
  opacity: 1;
}
.drawer {
  position: fixed;
  top: 0;
  right: -800px;
  width: 750px;
  height: 100%;
  background: #000000; /* Fully opaque surface */
  border-left: 1px solid var(--border);
  z-index: 2001;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
}

.drawer.active {
  right: 0;
}

.drawer-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
}

.drawer-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.drawer-content-main {
  flex: 7;
  padding: 24px 32px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.drawer-content-side {
  flex: 3;
  padding: 24px 20px;
  background: var(--surface2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap-4);
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--col-accent, var(--border-bright));
}

.col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: 'Space Mono', monospace;
  color: #ffffff;
}

.col-line {
  width: 12px;
  height: 2px;
  border-radius: 0;
  background: var(--col-accent, var(--border-bright));
}

.col-count {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 0;
}

.col-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.col-body::-webkit-scrollbar {
  width: 3px;
}

.col-body::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}

.col-body.drag-over {
  background: rgba(168, 85, 247, 0.08); /* Brighter purple */
  border-radius: 8px;
  outline: 2px dashed var(--accent);
}

.card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border: 1px dashed var(--accent);
}

/* CARD */
.card {
  background: #030303;
  border: 1px solid var(--border);
  border-radius: 12px !important;
  overflow: hidden;
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--border-bright);
  opacity: 0.5;
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 8px var(--accent-glow);
  background: #000000;
}

.card:hover::before {
  background: var(--accent);
  opacity: 1;
  width: 6px;
}

.card.needs-review {
  border-color: rgba(245, 166, 35, 0.3);
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.08);
}

.card.approved {
  border-color: rgba(46, 213, 115, 0.25);
}

.card.rejected {
  border-color: rgba(255, 71, 87, 0.25);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  flex: 1;
}

.card-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid;
}

.badge-type {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.badge-agent {
  background: rgba(255, 0, 0, 0.15);
  color: #ff3333;
  border-color: rgba(255, 0, 0, 0.5);
}

.badge-agent.investigador {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.badge-agent.supervisor {
  background: rgba(255, 0, 0, 0.2);
  color: #ff0000;
  border-color: #ff0000;
}

.badge-agent.revisor {
  background: rgba(100, 100, 100, 0.2);
  color: #cccccc;
  border-color: #cccccc;
}

.badge-agent.openclaw {
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ASSIGNEE BADGE */
.badge-assignee {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid;
  text-transform: uppercase;
  font-weight: 700;
}

.badge-assignee.human {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.badge-assignee.agent {
  background: rgba(255, 0, 0, 0.15);
  color: #ff0000;
  border-color: rgba(255, 0, 0, 0.4);
  box-shadow: 0 0 5px rgba(255, 0, 0, 0.2);
}

.review-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.review-pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warn);
}

.review-approved {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.review-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.card-menu {
  opacity: 0;
  transition: opacity 0.15s;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  flex-shrink: 0;
}

.card:hover .card-menu {
  opacity: 1;
}

.card-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 10px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-project {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
}

.card-project-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.priority {
  font-size: 9px;
  font-family: 'Space Mono', monospace;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid;
}

/* P1-P4 priority system — old names kept as aliases */
.priority-p1,
.priority-critica {
  background: rgba(230, 57, 70, 0.2);
  color: #E63946;
  border-color: #E63946;
  box-shadow: 0 0 6px rgba(230, 57, 70, 0.4);
}

.priority-p2,
.priority-alta {
  background: rgba(244, 162, 97, 0.15);
  color: #F4A261;
  border-color: #F4A261;
}

.priority-p3,
.priority-media {
  background: rgba(233, 196, 106, 0.1);
  color: #E9C46A;
  border-color: rgba(233, 196, 106, 0.4);
}

.priority-p4,
.priority-baja {
  background: rgba(255, 255, 255, 0.03);
  color: #666;
  border-color: rgba(255, 255, 255, 0.12);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.card-reviewer {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  color: var(--text-muted);
}

.card-by {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  color: var(--text-muted);
}

.by-ai {
  color: rgba(168, 85, 247, 0.7);
}

.add-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-weight: 700;
  letter-spacing: 1px;
}

.add-card:hover {
  background: rgba(255, 0, 0, 0.1);
  border-color: #ff0000;
  color: #ff0000;
}

.empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Space Mono', monospace;
  line-height: 2;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* REVIEW PANEL */
.side-panel {
  display: none;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 400px;
  background: #050505;
  border-left: 1px solid var(--border-bright);
  z-index: 50;
  overflow-y: auto;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}

.side-panel.open {
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: 'Space Mono', monospace;
}

.panel-title.warn {
  color: var(--warn);
}

.panel-title.accent {
  color: var(--accent);
}

.panel-body {
  padding: 20px 24px;
  flex: 1;
}

/* REVIEW CARD */
.review-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

.review-card.priority-critica {
  border-color: rgba(239, 68, 68, 0.3);
}

.rc-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.rc-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.rc-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}

.rc-actions {
  display: flex;
  gap: 8px;
}

.rc-notes {
  margin-top: 8px;
}

.rc-notes input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  outline: none;
}

.rc-notes input:focus {
  border-color: var(--accent);
}

/* RULES PANEL */
.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.rule-item:last-child {
  border-bottom: none;
}

.rule-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.rule-text {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}

.rule-scope {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.rule-project {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.rule-blocking {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.rule-warn {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--warn);
}

/* MODAL */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.98); /* Reduced transparency */
  backdrop-filter: blur(15px); /* Increased blur */
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 28px;
  width: 460px;
  max-width: 95vw;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 60px var(--accent-glow);
}

.modal h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-family: 'Space Mono', monospace;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group select option {
  background: var(--surface);
}

.form-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: 7px;
  cursor: pointer;
}

.form-toggle input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-toggle label {
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.implicit-deny-warning {
  display: none;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 7px;
  font-size: 11px;
  color: var(--warn);
  margin-bottom: 14px;
}

.implicit-deny-warning.show {
  display: block;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  font-family: 'Space Mono', monospace;
  z-index: 200;
  transform: translateX(120%);
  transition: transform 0.3s;
  max-width: 340px;
}

.toast.show {
  transform: translateX(0);
}

.toast.ai {
  border-color: rgba(168, 85, 247, 0.4);
}

.toast.warn {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warn);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

/* APP NAV — Kanban / Wiki switcher */
.app-nav {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
}

.nav-btn.active.wiki {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

/* WIKI FULL-SCREEN VIEW */
.wiki-view {
  display: none;
  flex: 1;
  overflow: hidden;
}

.wiki-view.active {
  display: flex;
}

.wiki-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wiki-sidebar-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.wiki-sidebar-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: 'Space Mono', monospace;
  margin-bottom: 10px;
}

.wiki-project-filter {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.wiki-project-filter:focus {
  border-color: var(--accent);
}

.wiki-project-filter option {
  background: var(--surface);
}

.wiki-pages-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.wiki-pages-list::-webkit-scrollbar {
  width: 3px;
}

.wiki-pages-list::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}

.wiki-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  padding: 10px 8px 6px;
}

.wiki-page-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.wiki-page-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.wiki-page-item.active {
  background: var(--surface2);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.1);
}

.wiki-page-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.wiki-page-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}

.wiki-page-item.active .wiki-page-name {
  color: var(--text);
}

.wiki-page-tags {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.wiki-tag {
  font-family: 'Space Mono', monospace;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.wiki-sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* WIKI EDITOR */
.wiki-editor-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.wiki-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.wiki-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wiki-mode-btn {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--text-dim);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}

.wiki-mode-btn.active {
  background: var(--surface2);
  color: var(--text);
  border-color: rgba(99, 102, 241, 0.5);
}

.wiki-title-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 20px 28px 8px;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  outline: none;
  flex-shrink: 0;
}

.wiki-title-input::placeholder {
  color: var(--text-muted);
}

.wiki-title-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.4), transparent);
  margin: 0 28px 0;
  flex-shrink: 0;
}

.wiki-content-area {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.wiki-textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  padding: 20px 28px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  outline: none;
  resize: none;
  overflow-y: auto;
}

.wiki-textarea::-webkit-scrollbar {
  width: 4px;
}

.wiki-textarea::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}

.wiki-preview-area {
  display: none;
  width: 100%;
  height: 100%;
  padding: 20px 28px;
  overflow-y: auto;
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
}

.wiki-preview-area.visible {
  display: block;
}

.wiki-preview-area::-webkit-scrollbar {
  width: 4px;
}

.wiki-preview-area::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}

/* Markdown preview styles */
.wiki-preview-area h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.wiki-preview-area h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 24px;
  color: var(--text);
}

.wiki-preview-area h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 18px;
  color: var(--text-dim);
}

.wiki-preview-area p {
  margin-bottom: 12px;
  color: var(--text-dim);
}

.wiki-preview-area code {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #c084fc;
}

.wiki-preview-area pre {
  background: var(--surface2);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.wiki-preview-area pre code {
  background: none;
  padding: 0;
  color: #a3e635;
}

.wiki-preview-area ul,
.wiki-preview-area ol {
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--text-dim);
}

.wiki-preview-area li {
  margin-bottom: 4px;
}

.wiki-preview-area blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.wiki-preview-area strong {
  color: var(--text);
  font-weight: 700;
}

.wiki-preview-area hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.wiki-preview-area a {
  color: #818cf8;
  text-decoration: underline;
}

.wiki-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: var(--text-muted);
}

.wiki-empty-state .empty-icon {
  font-size: 48px;
  opacity: 0.4;
}

.wiki-empty-state p {
  font-size: 13px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 1px;
}

.wiki-tags-input-wrap {
  padding: 8px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

.wiki-tags-label {
  font-size: 10px;
  font-family: 'Space Mono', monospace;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.wiki-tags-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  outline: none;
}

.wiki-tags-input::placeholder {
  color: var(--text-muted);
}

/* View transitions */
.board-wrap,
.wiki-view {
  animation: viewFadeIn 0.2s ease;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── BLOCK 15: AGENT AVATARS ──────────────────────────────── */
.card {
  position: relative;
}

.card-with-avatar {
  padding-bottom: 32px;
}

.agent-avatar {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Space Mono', 'Courier New', monospace;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  cursor: default;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  z-index: 10;
  animation: unit-pulse 3s ease-in-out infinite;
}

.agent-avatar.agent-unassigned {
  background: #2a2a3a;
  color: #555;
  animation: none;
}

.agent-avatar:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.agent-avatar::after {
  content: attr(data-agent-name);
  position: absolute;
  bottom: 30px;
  right: 0;
  background: rgba(8, 10, 16, 0.96);
  color: #a8d8ea;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  white-space: nowrap;
  padding: 3px 8px;
  border: 1px solid rgba(168, 216, 234, 0.25);
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 100;
}

.agent-avatar:hover::after {
  opacity: 1;
}

@keyframes unit-pulse {

  0%,
  100% {
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  }

  50% {
    box-shadow: 0 0 10px currentColor;
  }
}

.column[data-status="En Revision"] .col-header {
  --col-accent: #E9C46A;
}

.column[data-status="En Revision"] .col-body {
  background: #1a1200;
  border-radius: 4px;
}

/* Block 15 — avatar pulse for active tickets */
@keyframes avatar-pulse-active {

  0%,
  100% {
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6), 0 0 0 0 currentColor;
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 12px currentColor, 0 0 0 4px transparent;
    transform: scale(1.08);
  }
}

.agent-avatar.en-proceso {
  animation: avatar-pulse-active 1.4s ease-in-out infinite !important;
}

/* Mr O — cyberpunk ninja */
.agent-avatar.avatar-mr-o {
  background: radial-gradient(circle at 40% 35%, #3d0030 0%, #1a001a 60%, #0d0010 100%);
  border: 1.5px solid #E63946;
  font-size: 14px;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.6), inset 0 0 6px rgba(106, 76, 147, 0.4);
  animation: ninja-idle-glow 2s ease-in-out infinite !important;
}

@keyframes ninja-idle-glow {

  0%,
  100% {
    box-shadow: 0 0 6px rgba(230, 57, 70, 0.5), inset 0 0 4px rgba(106, 76, 147, 0.3);
    border-color: rgba(230, 57, 70, 0.7);
  }

  50% {
    box-shadow: 0 0 14px rgba(230, 57, 70, 0.9), 0 0 24px rgba(106, 76, 147, 0.4);
    border-color: #ff6b8a;
  }
}

.agent-avatar.avatar-mr-o:hover {
  animation: ninja-spin 0.35s cubic-bezier(0.25, 1.5, 0.5, 1) forwards !important;
}

@keyframes ninja-spin {
  0% {
    transform: scale(1.2) rotate(0deg);
    filter: hue-rotate(0deg);
  }

  30% {
    transform: scale(1.3) rotate(-20deg);
    filter: hue-rotate(60deg);
  }

  65% {
    transform: scale(1.3) rotate(25deg);
    filter: hue-rotate(-40deg);
  }

  85% {
    transform: scale(1.25) rotate(-8deg);
  }

  100% {
    transform: scale(1.2) rotate(0deg);
    filter: hue-rotate(0deg);
  }
}

.agent-avatar.avatar-mr-o.en-proceso {
  animation: ninja-idle-glow 0.9s ease-in-out infinite !important;
}

/* Standardized NERV Header */
.nerv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--accent);
  position: sticky; top: 0; z-index: 9999; font-family: 'Space Mono', monospace; } .nerv-brand { font-size: 18px; font-weight: 700; color: var(--accent) !important; text-decoration: none; letter-spacing: 2px; display: flex; align-items: center; gap: 10px; } .nerv-nav { display: flex; gap: 12px; flex-wrap: wrap; } .nerv-nav a, .nerv-nav button { color: var(--text-dim) !important; text-decoration: none; font-size: 10px; text-transform: uppercase; transition: all 0.2s; padding: 4px 8px; border: 1px solid transparent; background: none; cursor: pointer; font-family: 'Space Mono', monospace; } .nerv-nav a:hover, .nerv-nav button:hover, .nerv-nav a.active, .nerv-nav button.active { color: #fff !important; border-color: var(--accent); }
