/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Koho', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Global Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

:root {
  --sidebar-width: 280px;
  /* Brand Color System (EI Soluções Inteligentes) */
  --brand-blue: #1E4769;
  --brand-green: #BADA55;
  --brand-green-rgb: 186, 218, 85;
  
  --bg-main: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-solid: #ffffff;
  --bg-node: #ffffff;
  --bg-node-hover: #ffffff;
  --bg-input: #ffffff;
  --bg-prereq: rgba(255, 255, 255, 0.5);
  --bg-prereq-hover: rgba(255, 255, 255, 0.9);
  --bg-prereq-highlighted: rgba(var(--highlight-color-rgb, 30, 71, 105), 0.04);
  --bg-action-bar: rgba(30, 71, 105, 0.02);
  --bg-stat-box: rgba(30, 71, 105, 0.02);
  --canvas-grid-dot: rgba(30, 71, 105, 0.02);
  
  --border-color: rgba(30, 71, 105, 0.12);
  --border-hover: rgba(30, 71, 105, 0.22);
  
  --text-primary: #1e293b;     /* Slate 800 */
  --text-secondary: #475569;   /* Slate 600 */
  --text-muted: #64748b;       /* Slate 500 */
  --text-accent: var(--brand-blue);
  
  /* Role Colors matching brand scheme */
  --color-analista: #d97706;      /* Orange */
  --color-analista-rgb: 217, 119, 6;
  --color-designer: #7c3aed;      /* Purple */
  --color-designer-rgb: 124, 58, 237;
  --color-dev: #0891b2;           /* Light Blue */
  --color-dev-rgb: 8, 145, 178;
  --color-equipe: #15803d;        /* Green */
  --color-equipe-rgb: 21, 128, 61;
  --color-system: #4f46e5;        /* Indigo */
  --color-system-rgb: 79, 70, 229;
  --color-primary-rgb: 30, 71, 105;
  
  --color-active-glow: #BADA55;   /* Brand Green */
  --svg-arrow-color: rgba(30, 71, 105, 0.4);
  --svg-line-color: rgba(30, 71, 105, 0.15);
  --bg-canvas: #f4f6f9;           /* Soft grey-blue canvas background */
  --canvas-container-border: 2px solid rgba(30, 71, 105, 0.28);
  --canvas-container-shadow: 0 12px 36px rgba(30, 71, 105, 0.08);
  --swimlane-border-color: rgba(30, 71, 105, 0.22);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Scrollbar Colors */
  --scrollbar-track: rgba(30, 71, 105, 0.02);
  --scrollbar-thumb: rgba(30, 71, 105, 0.15);
  --scrollbar-thumb-hover: rgba(30, 71, 105, 0.25);
}

/* Dark Mode Variables Override */
body.dark-mode {
  --bg-main: #0b0f19;
  --bg-card: rgba(20, 29, 47, 0.7);
  --bg-card-solid: #1e293b;
  --bg-node: #1e293b;
  --bg-node-hover: #334155;
  --bg-input: #0f172a;
  --bg-prereq: rgba(30, 41, 59, 0.5);
  --bg-prereq-hover: rgba(30, 41, 59, 0.9);
  --bg-prereq-highlighted: rgba(var(--highlight-color-rgb, 255, 255, 255), 0.06);
  --bg-action-bar: rgba(255, 255, 255, 0.02);
  --bg-stat-box: rgba(255, 255, 255, 0.02);
  --canvas-grid-dot: rgba(255, 255, 255, 0.03);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #60a5fa; /* Sky Blue for title highlights in dark mode */
  
  --color-analista: #f59e0b;      /* Bright Orange */
  --color-analista-rgb: 245, 158, 11;
  --color-designer: #a78bfa;      /* Bright Purple */
  --color-designer-rgb: 167, 139, 250;
  --color-dev: #22d3ee;           /* Bright Cyan */
  --color-dev-rgb: 34, 211, 238;
  --color-equipe: #22c55e;        /* Bright Green */
  --color-equipe-rgb: 34, 197, 94;
  --color-system: #818cf8;        /* Bright Indigo */
  --color-system-rgb: 129, 140, 248;
  
  --svg-arrow-color: rgba(255, 255, 255, 0.4);
  --svg-line-color: rgba(255, 255, 255, 0.15);
  --bg-canvas: #121824;           /* Rich dark-blue canvas background */
  --canvas-container-border: 2px solid rgba(255, 255, 255, 0.2);
  --canvas-container-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  --swimlane-border-color: rgba(255, 255, 255, 0.16);

  /* Scrollbar Colors */
  --scrollbar-track: rgba(255, 255, 255, 0.02);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.25);
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Ambient Background Glow */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
}

.gc-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--brand-blue) 0%, transparent 70%);
  top: -100px;
  right: -50px;
}

.gc-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--brand-green) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
}

.gc-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-designer) 0%, transparent 70%);
  top: 30%;
  left: 20%;
}

/* Main Dashboard Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.5rem;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

/* Header styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  background: var(--brand-blue);
  backdrop-filter: blur(12px);
  padding: 1.25rem 2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.15);
  color: #ffffff;
}

.app-header h1 {
  font-family: 'Koho', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #d2f85a, var(--brand-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header p.subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.badge-primary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--brand-green);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Filter Controls */
.role-filters-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.role-filters {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.filter-btn.active {
  background: var(--brand-green);
  color: #1e293b;
  border-color: var(--brand-green);
  box-shadow: 0 4px 12px rgba(186, 218, 85, 0.35);
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.bg-all { background-color: var(--brand-green); }
.bg-analista { background-color: var(--color-analista); }
.bg-designer { background-color: var(--color-designer); }
.bg-dev { background-color: var(--color-dev); }
.bg-equipe { background-color: var(--color-equipe); }

/* Workspace Layout Grid */
.workspace {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* Sidebar Styles */
.sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.05);
}

.sidebar-left {
  width: 100%;
}

.sidebar-right {
  width: 100%;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  color: var(--text-accent);
}

.sidebar h2 {
  font-family: 'Koho', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-accent);
}

/* Left Sidebar: Prerequisites cards */
.prereq-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
}

.prereq-card {
  background: var(--bg-prereq);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: all var(--transition-normal);
}

.prereq-card:hover {
  background: var(--bg-prereq-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.prereq-card.highlighted {
  border-color: var(--highlight-color, var(--text-accent));
  background: var(--bg-prereq-highlighted);
  box-shadow: 0 0 15px rgba(var(--highlight-color-rgb, 30, 71, 105), 0.08);
}

.prereq-card.dimmed {
  opacity: 0.35;
  filter: grayscale(80%);
}

.prereq-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.prereq-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-accent);
}

.card-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon-wrapper svg {
  width: 16px;
  height: 16px;
}

.p-roadmap { background: rgba(30, 71, 105, 0.08); color: var(--brand-blue); }
.p-business { background: rgba(71, 85, 105, 0.08); color: var(--color-analista); }
.p-designer { background: rgba(14, 116, 144, 0.08); color: var(--color-designer); }
.p-dev { background: rgba(30, 71, 105, 0.08); color: var(--color-dev); }

.prereq-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.prereq-bullets {
  margin-top: 0.5rem;
  padding-left: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.prereq-bullets li {
  margin-bottom: 0.25rem;
}

/* Central Canvas Area */
.canvas-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.05);
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 600px;
}

.canvas-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-action-bar);
  z-index: 10;
}

.simulation-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  transition: all var(--transition-normal);
}

.status-indicator.active {
  background-color: var(--color-equipe);
  box-shadow: 0 0 8px var(--color-equipe);
  animation: pulse 1.5s infinite;
}

.status-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-green), #a3c42e);
  border: none;
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(186, 218, 85, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(186, 218, 85, 0.5);
  background: linear-gradient(135deg, #c7ee4c, var(--brand-green));
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(30, 71, 105, 0.04);
  border: 1px solid var(--border-color);
  color: var(--brand-blue);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(30, 71, 105, 0.08);
}

body.dark-mode .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
}

body.dark-mode .btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon {
  width: 14px;
  height: 14px;
}

/* Canvas Area Inner */
.canvas-inner {
  flex: 1;
  position: relative;
  overflow: auto;
  background-image: 
    radial-gradient(var(--canvas-grid-dot) 1px, transparent 1px),
    radial-gradient(var(--canvas-grid-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

/* Connections SVG Overlay */
.connections-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.connection-path {
  fill: none;
  stroke: var(--svg-line-color);
  stroke-width: 2;
  transition: stroke var(--transition-normal), stroke-width var(--transition-normal);
  marker-end: url(#arrow);
}

.connection-path.bidirectional {
  marker-start: url(#arrow);
}

.connection-path.highlighted {
  stroke: var(--highlight-color, var(--color-active-glow));
  stroke-width: 3;
  filter: drop-shadow(0 0 3px rgba(var(--highlight-color-rgb, 30, 71, 105), 0.3));
}

.connection-path.dimmed {
  opacity: 0.15;
}

/* Animated flow lines */
.flow-path {
  fill: none;
  stroke: var(--brand-green);
  stroke-dasharray: 6 6;
  stroke-width: 3;
  animation: march 1s linear infinite;
  marker-end: url(#arrow-active);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.flow-path.active {
  opacity: 1;
}

@keyframes march {
  to {
    stroke-dashoffset: -12;
  }
}

/* Grid layout of nodes */
.nodes-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3.5rem 2.5rem;
  padding: 3rem 2rem;
  justify-items: center;
  align-items: center;
  min-width: 1000px;
}

.node-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Flowchart Nodes */
.flow-node {
  background: var(--bg-node);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 220px;
  min-height: 110px;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 10px 20px rgba(30, 71, 105, 0.06);
  display: flex;
  flex-direction: column;
}

/* Accent top-borders for role distinction */
.flow-node.node-system { border-top: 4px solid var(--color-system); }
.flow-node.node-role-analista { border-top: 4px solid var(--color-analista); }
.flow-node.node-role-designer { border-top: 4px solid var(--color-designer); }
.flow-node.node-role-dev { border-top: 4px solid var(--color-dev); }
.flow-node.node-role-equipe { border-top: 4px solid var(--color-equipe); }

.flow-node:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px rgba(30, 71, 105, 0.14);
  background: var(--bg-node-hover);
}

.flow-node.dimmed {
  opacity: 0.35;
  filter: grayscale(85%);
}

.flow-node.active-sim {
  animation: nodePulse 2s infinite ease-in-out;
  background: var(--bg-node-hover);
}

.flow-node.node-system.active-sim { border-color: var(--color-system); box-shadow: 0 0 20px rgba(79, 70, 229, 0.4); }
.flow-node.node-role-analista.active-sim { border-color: var(--color-analista); box-shadow: 0 0 20px rgba(217, 119, 6, 0.4); }
.flow-node.node-role-designer.active-sim { border-color: var(--color-designer); box-shadow: 0 0 20px rgba(124, 58, 237, 0.4); }
.flow-node.node-role-dev.active-sim { border-color: var(--color-dev); box-shadow: 0 0 20px rgba(8, 145, 178, 0.4); }
.flow-node.node-role-equipe.active-sim { border-color: var(--color-equipe); box-shadow: 0 0 20px rgba(21, 128, 61, 0.4); }

@keyframes nodePulse {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.role-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Node Icons and Header badges based on roles */
.node-system .role-badge { background: rgba(79, 70, 229, 0.08); color: var(--color-system); }
.node-role-analista .role-badge { background: rgba(217, 119, 6, 0.08); color: var(--color-analista); }
.node-role-designer .role-badge { background: rgba(124, 58, 237, 0.08); color: var(--color-designer); }
.node-role-dev .role-badge { background: rgba(8, 145, 178, 0.08); color: var(--color-dev); }
.node-role-equipe .role-badge { background: rgba(21, 128, 61, 0.08); color: var(--color-equipe); }

.node-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.node-icon svg {
  width: 100%;
  height: 100%;
}

.node-system:hover { border-color: var(--color-system); }
.node-role-analista:hover { border-color: var(--color-analista); }
.node-role-designer:hover { border-color: var(--color-designer); }
.node-role-dev:hover { border-color: var(--color-dev); }
.node-role-equipe:hover { border-color: var(--color-equipe); }

/* Selected Filter glow states */
.filter-analista .node-role-analista { border-color: var(--color-analista); box-shadow: 0 0 15px rgba(217, 119, 6, 0.15); }
.filter-designer .node-role-designer { border-color: var(--color-designer); box-shadow: 0 0 15px rgba(124, 58, 237, 0.15); }
.filter-dev .node-role-dev { border-color: var(--color-dev); box-shadow: 0 0 15px rgba(8, 145, 178, 0.15); }
.filter-equipe .node-role-equipe { border-color: var(--color-equipe); box-shadow: 0 0 15px rgba(21, 128, 61, 0.15); }

.node-body h3 {
  font-family: 'Koho', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.node-body p {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Custom Connection Labels inside SVG */
.connection-label {
  position: absolute;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(30, 71, 105, 0.1);
}

.label-sim {
  background-color: rgba(142, 164, 59, 0.12);
  color: var(--color-equipe);
  border: 1px solid rgba(142, 164, 59, 0.25);
}

.label-nao {
  background-color: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Right Sidebar: Backlog Panel */
.backlog-container {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  width: 100%;
  align-items: stretch;
}

.backlog-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 160px;
  flex-shrink: 0;
}

.stat-box {
  background: var(--bg-stat-box);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.625rem;
  text-align: center;
  flex: 1;
}

.stat-num {
  display: block;
  font-family: 'Koho', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-accent);
}

.stat-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.backlog-list {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  padding-bottom: 0.5rem;
  align-items: center;
  min-height: 120px;
}

.backlog-empty {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 1rem;
  color: var(--text-muted);
  flex: 1;
  text-align: left;
}

.backlog-empty svg {
  width: 32px;
  height: 32px;
  margin-bottom: 0;
  stroke: rgba(30, 71, 105, 0.15);
  flex-shrink: 0;
}

.backlog-empty p {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.backlog-empty span {
  font-size: 0.75rem;
}

.backlog-item {
  background: var(--bg-backlog-item);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.875rem;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all var(--transition-normal);
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(30, 71, 105, 0.02);
}

.backlog-item:hover {
  background: var(--bg-backlog-item-hover);
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(30, 71, 105, 0.08);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.backlog-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.backlog-item h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-accent);
}

.backlog-id {
  font-family: 'Koho', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-accent);
}

.backlog-item p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.backlog-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.meta-cycles {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(142, 164, 59, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--color-equipe);
  border: 1px solid rgba(142, 164, 59, 0.25);
}

.meta-cycles svg {
  width: 10px;
  height: 10px;
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 71, 105, 0.4);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 480px;
  max-width: 90%;
  box-shadow: 0 20px 50px rgba(30, 71, 105, 0.15);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-family: 'Koho', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-accent);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-green);
  background: var(--bg-input);
  box-shadow: 0 0 10px rgba(186, 218, 85, 0.2);
}

.form-group textarea {
  height: 80px;
  resize: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(30, 71, 105, 0.02);
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-cancel:hover {
  background: rgba(30, 71, 105, 0.04);
  color: var(--text-primary);
}

.modal-footer .btn-submit {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
}

/* Simulation Info Overlay Panel */
.sim-info-panel {
  position: fixed;
  bottom: 2rem;
  left: calc(var(--sidebar-width) + 2rem);
  width: 320px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(30, 71, 105, 0.15);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(150%);
  transition: transform var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1), left var(--transition-normal);
}

.sim-info-panel.open {
  transform: translateY(0);
}

.sim-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(30, 71, 105, 0.02);
}

.active-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 0.05em;
  background: rgba(30, 71, 105, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  margin-bottom: 0.35rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-equipe);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 6px var(--color-equipe); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.sim-info-panel h4 {
  font-family: 'Koho', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-accent);
}

.sim-panel-body {
  padding: 1.25rem;
  max-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#sim-current-step {
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
}

.sim-timeline {
  flex: 1;
  overflow-y: auto;
  border-left: 1px solid rgba(30, 71, 105, 0.1);
  padding-left: 0.75rem;
  margin-left: 0.25rem;
}

.sim-timeline::-webkit-scrollbar {
  width: 4px;
}
.sim-timeline::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 2px;
}

.timeline-events {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-event {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  line-height: 1.35;
  position: relative;
  animation: slideIn 0.2s ease-out;
}

.timeline-event::before {
  content: '';
  position: absolute;
  left: calc(-0.75rem - 4.5px);
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.timeline-event.active-event::before {
  background-color: var(--color-equipe);
  box-shadow: 0 0 6px var(--color-equipe);
}

.sim-panel-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: rgba(30, 71, 105, 0.02);
  display: flex;
  justify-content: flex-end;
}

.sim-panel-footer button {
  width: 100%;
  justify-content: center;
}

/* Decision Modal Overlay */
.decision-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 71, 105, 0.45);
  backdrop-filter: blur(8px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.decision-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.decision-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 440px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(30, 71, 105, 0.15);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.decision-overlay.open .decision-card {
  transform: scale(1);
}

.decision-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(30, 71, 105, 0.05);
  color: var(--text-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  border: 1px solid var(--border-color);
}

.decision-icon svg {
  width: 28px;
  height: 28px;
}

.decision-card h2 {
  font-family: 'Koho', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
}

.decision-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 1.75rem;
}

.decision-buttons {
  display: flex;
  gap: 0.75rem;
}

.decision-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-no {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-no:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-yes {
  background: linear-gradient(135deg, var(--brand-green), #a3c42e);
  border: none;
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(186, 218, 85, 0.3);
}

.btn-yes:hover {
  box-shadow: 0 6px 20px rgba(186, 218, 85, 0.45);
  transform: translateY(-1px);
}

/* Responsiveness adjustments */
@media (max-width: 1200px) {
  .workspace {
    flex-direction: column;
  }
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-left: 1rem;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

.theme-icon {
  width: 18px;
  height: 18px;
}

/* --- Sidebar Navigation & Dashboard Layout --- */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar-nav {
  width: var(--sidebar-width);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: width var(--transition-normal), padding var(--transition-normal);
  overflow: hidden;
}

/* Collapsed Sidebar overrides */
body {
  --sidebar-width: 280px;
}
body.sidebar-collapsed {
  --sidebar-width: 76px;
}

.sidebar-nav.collapsed {
  padding: 1.5rem 0.5rem;
  align-items: center;
}

.sidebar-nav.collapsed .brand-name,
.sidebar-nav.collapsed .nav-links span {
  display: none;
}

.sidebar-nav.collapsed .nav-link a {
  justify-content: center;
  padding: 0.75rem;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.sidebar-nav.collapsed .brand-area {
  justify-content: center;
  padding: 0.5rem 0;
}

/* Toggle Sidebar button style */
.toggle-sidebar-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.toggle-sidebar-btn:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--text-primary);
}

.brand-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem;
  width: 100%;
}

.brand-logo-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-link a:hover {
  background: rgba(var(--color-primary-rgb), 0.04);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.nav-link.active a {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(30, 71, 105, 0.15);
}

body.dark-mode .nav-link.active a {
  background: var(--brand-green);
  color: #0b0f19;
  box-shadow: 0 4px 15px rgba(186, 218, 85, 0.3);
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.roadmap-main, .flowchart-main {
  max-width: none;
}

/* Dashboard specific cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.03);
  transition: all var(--transition-normal);
  text-decoration: none;
}

.dash-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 35px rgba(30, 71, 105, 0.08);
}

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

.dash-card h3 {
  font-family: 'Koho', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-accent);
}

.dash-card p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dash-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Override workspace full width when in layout */
.main-content .workspace {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Top Backlog Section --- */
.top-backlog-area {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.02);
}

.top-backlog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-backlog-header h2 {
  font-family: 'Koho', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-accent);
}

.top-backlog-list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.top-backlog-list::-webkit-scrollbar {
  height: 6px;
}
.top-backlog-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.top-backlog-card {
  background: var(--bg-stat-box);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  min-width: 250px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.top-backlog-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-solid);
}

.top-backlog-card h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-backlog-card p {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Floating Engineer Hints --- */
.engineer-hint-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 99;
  transition: all var(--transition-fast);
}

.engineer-hint-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.engineer-hint-panel {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 350px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  padding: 1.25rem;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}

.engineer-hint-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.engineer-hint-panel h3 {
  font-family: 'Koho', sans-serif;
  font-size: 0.95rem;
  color: var(--text-accent);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.hint-item {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.5rem;
}

.hint-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hint-item strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.15rem;
}

/* --- Specific AI Agent Colors --- */
.node-agent-analista { border-top: 4px solid var(--color-analista) !important; }
.node-agent-analista .role-badge { background: rgba(var(--color-analista-rgb), 0.08) !important; color: var(--color-analista) !important; }
.node-agent-analista.active-sim { border-color: var(--color-analista) !important; box-shadow: 0 0 20px rgba(var(--color-analista-rgb), 0.4) !important; }

.node-agent-teste { border-top: 4px solid var(--color-system) !important; }
.node-agent-teste .role-badge { background: rgba(var(--color-system-rgb), 0.08) !important; color: var(--color-system) !important; }
.node-agent-teste.active-sim { border-color: var(--color-system) !important; box-shadow: 0 0 20px rgba(var(--color-system-rgb), 0.4) !important; }

.node-agent-dev { border-top: 4px solid var(--color-dev) !important; }
.node-agent-dev .role-badge { background: rgba(var(--color-dev-rgb), 0.08) !important; color: var(--color-dev) !important; }
.node-agent-dev.active-sim { border-color: var(--color-dev) !important; box-shadow: 0 0 20px rgba(var(--color-dev-rgb), 0.4) !important; }

.node-agent-quali { border-top: 4px solid var(--color-equipe) !important; }
.node-agent-quali .role-badge { background: rgba(var(--color-equipe-rgb), 0.08) !important; color: var(--color-equipe) !important; }
.node-agent-quali.active-sim { border-color: var(--color-equipe) !important; box-shadow: 0 0 20px rgba(var(--color-equipe-rgb), 0.4) !important; }

/* --- Emergency Stop Red Button --- */
.btn-danger-stop {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35) !important;
}

.btn-danger-stop:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171, #ef4444) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5) !important;
  transform: translateY(-1px);
}

.btn-danger-stop:active {
  transform: translateY(0);
}

/* --- Active Agent Timer Badge --- */
.agent-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(30, 71, 105, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  width: fit-content;
  transition: all var(--transition-fast);
}

body.dark-mode .agent-timer {
  background: rgba(255, 255, 255, 0.05);
}

.active-sim .agent-timer {
  color: var(--text-primary);
  border-color: rgba(var(--brand-green-rgb), 0.4);
  background: rgba(var(--brand-green-rgb), 0.1);
  animation: pulse-timer 2s infinite;
}

@keyframes pulse-timer {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* --- Agent Detail Modal --- */
.agent-detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.agent-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.agent-tab-btn:hover {
  color: var(--text-primary);
}

.agent-tab-btn.active {
  color: var(--text-accent);
  border-bottom-color: var(--text-accent);
}

.agent-tab-content {
  display: none;
  font-size: 0.8125rem;
}

.agent-tab-content.active {
  display: block;
}

/* Log and Queue designs */
.agent-log-list, .agent-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
}

.agent-log-item, .agent-queue-item {
  background: rgba(30, 71, 105, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.625rem;
  border-radius: 8px;
  line-height: 1.4;
}

body.dark-mode .agent-log-item, body.dark-mode .agent-queue-item {
  background: rgba(255, 255, 255, 0.02);
}

.agent-log-item span.timestamp {
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.15rem;
}

/* Code and Markdown container */
.agent-memory-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Live Task Monitor Panel --- */
.live-monitor-panel {
  flex: 1.2;
  background: rgba(30, 71, 105, 0.02);
  border-left: 1px solid var(--border-color);
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body.dark-mode .live-monitor-panel {
  border-left-color: rgba(255, 255, 255, 0.08);
}

.live-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.live-monitor-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.live-branch-badge {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  font-weight: bold;
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--brand-blue);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

body.dark-mode .live-branch-badge {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}

.live-monitor-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  min-height: 110px;
}

.live-monitor-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.live-monitor-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.live-changes-list, .live-qa-logs {
  background: rgba(30, 71, 105, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 0.72rem;
  font-family: 'Courier New', Courier, monospace;
  height: 90px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

body.dark-mode .live-changes-list, body.dark-mode .live-qa-logs {
  background: rgba(0, 0, 0, 0.2);
}

.change-item {
  color: var(--text-secondary);
}

.change-item.add { color: #10b981; }
.change-item.mod { color: #3b82f6; }

.qa-log-item {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.qa-log-item.ok { color: #10b981; }
.qa-log-item.fail { color: #ef4444; }
.qa-log-item.pending { color: var(--text-muted); }

.live-monitor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  font-style: italic;
  grid-column: span 2;
}

/* --- Roadmap Planning Styles --- */
.roadmap-controls {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.02);
}

.roadmap-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.roadmap-form .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 180px;
}

.roadmap-tabs-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.roadmap-tabs {
  display: flex;
  gap: 0.5rem;
}

.roadmap-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.roadmap-tab-btn:hover {
  background: var(--bg-node-hover);
  color: var(--text-primary);
}

.roadmap-tab-btn.active {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 4px 12px rgba(30, 71, 105, 0.2);
}

body.dark-mode .roadmap-tab-btn.active {
  background: var(--brand-green);
  color: #0b0f19;
  border-color: var(--brand-green);
  box-shadow: 0 4px 12px rgba(186, 218, 85, 0.3);
}

/* Kanban Columns */
.roadmap-kanban {
  display: flex;
  gap: 1.25rem;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 1.25rem;
  align-items: flex-start;
}

/* Custom scrollbar for premium feel */
.roadmap-kanban::-webkit-scrollbar {
  height: 8px;
}
.roadmap-kanban::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 4px;
}
.roadmap-kanban::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
.roadmap-kanban::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.kanban-column {
  flex: 0 0 290px;
  min-width: 290px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 520px;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.02);
  transition: all var(--transition-normal);
}

.kanban-column.drag-over {
  border-color: var(--brand-green);
  background: rgba(var(--brand-green-rgb), 0.04);
}

.kanban-column h3 {
  font-family: 'Koho', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column h3 span.badge-count {
  font-size: 0.75rem;
  background: rgba(30, 71, 105, 0.08);
  color: var(--text-secondary);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

body.dark-mode .kanban-column h3 span.badge-count {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.kanban-notes-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  overflow-y: auto;
  min-height: 400px;
}

/* Sticky notes */
.roadmap-note {
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  cursor: grab;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roadmap-note:active {
  cursor: grabbing;
}

.roadmap-note.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.roadmap-note:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

/* Post-it colors themes (harmonic) */
.note-cyan {
  border-left: 5px solid #22d3ee !important;
  background: rgba(34, 211, 238, 0.06);
}
.note-orange {
  border-left: 5px solid #fb923c !important;
  background: rgba(251, 146, 60, 0.06);
}
.note-purple {
  border-left: 5px solid #c084fc !important;
  background: rgba(192, 132, 252, 0.06);
}
.note-green {
  border-left: 5px solid #4ade80 !important;
  background: rgba(74, 222, 128, 0.06);
}

body.dark-mode .roadmap-note {
  background: #1e293b;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.note-title {
  font-family: 'Koho', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
  word-break: break-word;
}

.btn-delete-note {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-delete-note:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.note-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

/* Free-form Whiteboard Canvas */
.whiteboard-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.05);
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 600px;
}

.whiteboard-canvas {
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(var(--canvas-grid-dot) 1.5px, transparent 1.5px);
  background-size: 30px 30px;
  background-position: 0 0;
  position: relative;
  overflow: auto;
  cursor: cell;
}

.whiteboard-canvas.dragging-canvas {
  cursor: grab;
}

.whiteboard-canvas.dragging-canvas:active {
  cursor: grabbing;
}

.whiteboard-help-text {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: rgba(30, 71, 105, 0.08);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  pointer-events: none;
  z-index: 5;
  border: 1px solid var(--border-color);
}

body.dark-mode .whiteboard-help-text {
  background: rgba(255, 255, 255, 0.08);
}

/* Draggable post-it inside Whiteboard */
.whiteboard-postit {
  position: absolute;
  width: 180px;
  height: 140px;
  min-width: 120px;
  min-height: 100px;
  resize: both;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 2px 8px 20px rgba(0, 0, 0, 0.1);
  padding: 0.875rem;
  cursor: move;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: box-shadow 0.2s, transform 0.1s;
  z-index: 10;
}

body.dark-mode .whiteboard-postit {
  background: #1e293b;
}

.whiteboard-postit:hover {
  box-shadow: 4px 12px 25px rgba(0, 0, 0, 0.16);
}

.whiteboard-postit.dragging {
  z-index: 99;
  transform: scale(1.03) rotate(1deg);
  opacity: 0.9;
  cursor: grabbing;
}

.whiteboard-postit .postit-desc {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
  width: 100%;
  flex: 1;
  outline: none;
  font-family: inherit;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.whiteboard-postit .postit-desc:empty::before {
  content: attr(placeholder);
  color: var(--text-muted);
  opacity: 0.6;
}

.whiteboard-postit .postit-desc:focus {
  border-bottom: 1px dashed var(--border-color);
}

/* --- Glossary View Styles --- */
.glossary-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.glossary-controls {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.02);
}

.glossary-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.glossary-form .form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.glossary-list-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.02);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.glossary-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.glossary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: var(--border-hover);
}

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

.glossary-card-term {
  font-family: 'Koho', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-accent);
}

.glossary-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

/* --- Inline Glossary Highlight & Tooltip --- */
.glossary-term {
  border-bottom: 2px dashed var(--brand-green);
  cursor: help;
  position: relative;
  font-weight: 600;
  color: var(--text-accent);
}

/* Floating Glossary Info Box */
.glossary-floating-tooltip {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  background: rgba(30, 41, 59, 0.92);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(186, 218, 85, 0.35);
  color: #ffffff;
  padding: 0.875rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  z-index: 10000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  opacity: 0;
  max-width: 600px;
  width: 90%;
  pointer-events: none;
}

.glossary-floating-tooltip.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.glossary-floating-tooltip .tooltip-content {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.glossary-floating-tooltip .tooltip-icon {
  width: 22px;
  height: 22px;
  color: var(--brand-green);
  flex-shrink: 0;
}

.glossary-floating-tooltip .tooltip-text {
  font-size: 0.84rem;
  line-height: 1.45;
  font-family: 'Koho', -apple-system, sans-serif;
}

.glossary-floating-tooltip .tooltip-term {
  color: var(--brand-green);
  font-weight: 700;
}

/* Dark mode adjustments */
body.dark-mode .glossary-floating-tooltip {
  background: rgba(11, 15, 25, 0.94);
  border-color: rgba(186, 218, 85, 0.25);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* --- Epic Page specific styles --- */
.editable-field:hover {
  border-color: rgba(186, 218, 85, 0.4) !important;
  background: rgba(30, 71, 105, 0.04);
}

.editable-field:focus {
  border-color: var(--brand-green) !important;
  background: rgba(30, 71, 105, 0.08);
}

body.dark-mode .editable-field:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .editable-field:focus {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  .epic-board-grid {
    grid-template-columns: 1fr !important;
  }
}

.epic-notes-mural .note-desc {
  border-radius: 4px;
  padding: 2px 4px;
  border: 1px dashed transparent;
  transition: all 0.2s;
}

.epic-notes-mural .note-desc:hover {
  border-color: rgba(186, 218, 85, 0.4);
  background: rgba(30, 71, 105, 0.03);
}

.epic-notes-mural .note-desc:focus {
  border-color: var(--brand-green);
  background: rgba(30, 71, 105, 0.06);
}

body.dark-mode .epic-notes-mural .note-desc:hover {
  background: rgba(255, 255, 255, 0.02);
}

body.dark-mode .epic-notes-mural .note-desc:focus {
  background: rgba(255, 255, 255, 0.04);
}

.epic-link {
  color: #3b82f6;
  text-decoration: underline;
  cursor: pointer;
  pointer-events: auto;
  font-weight: 500;
  transition: color 0.2s;
}

.epic-link:hover {
  color: #1d4ed8;
}

body.dark-mode .epic-link {
  color: var(--brand-green);
}

body.dark-mode .epic-link:hover {
  color: #a3c745;
}

/* --- Sync Status Indicator Styles --- */
.sync-status-container {
  margin-top: auto; /* Push it to the bottom of the sidebar */
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(30, 71, 105, 0.04);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

body.dark-mode .sync-status-container {
  background: rgba(255, 255, 255, 0.02);
}

.sync-status-container:hover {
  background: rgba(30, 71, 105, 0.08);
  border-color: var(--border-hover);
}

body.dark-mode .sync-status-container:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: background-color var(--transition-normal), box-shadow var(--transition-normal);
}

.sync-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Status colors and animations */
.sync-status-container.status-synced .sync-dot {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.sync-status-container.status-synced .sync-text {
  color: #22c55e;
}

.sync-status-container.status-pending .sync-dot {
  background-color: var(--color-analista);
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.6);
}

.sync-status-container.status-pending .sync-text {
  color: var(--color-analista);
}

.sync-status-container.status-saving .sync-dot {
  background-color: var(--color-dev);
  box-shadow: 0 0 8px rgba(8, 145, 178, 0.6);
  animation: pulse 1.5s infinite;
}

.sync-status-container.status-saving .sync-text {
  color: var(--color-dev);
}

/* Hide text when sidebar is collapsed */
.sidebar-nav.collapsed .sync-status-container {
  padding: 0.75rem;
  justify-content: center;
  width: 42px;
  height: 42px;
}

.sidebar-nav.collapsed .sync-status-container .sync-text {
  display: none;
}

/* --- Grouped Sidebar Section Titles --- */
.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  opacity: 0.8;
  white-space: nowrap;
}
.sidebar-nav.collapsed .sidebar-section-title {
  display: none;
}

/* --- Product Logic Page Styles (produto.html) --- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: 2fr 1.2fr;
  }
}
.personas-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.persona-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.persona-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(30, 71, 105, 0.08);
}
.persona-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.persona-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30, 71, 105, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  font-weight: 700;
  font-size: 1.1rem;
}
.persona-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-accent);
}
.persona-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.persona-quote {
  font-style: italic;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-left: 2px solid var(--brand-green);
  padding-left: 0.5rem;
  margin-top: 0.25rem;
}

/* Traceability Matrix Table Styling */
.traceability-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.traceability-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}
.traceability-table th, .traceability-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}
.traceability-table th {
  background: var(--bg-action-bar);
  font-weight: 600;
  color: var(--text-accent);
}
.traceability-table tr:hover {
  background: rgba(var(--color-primary-rgb), 0.02);
}
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-covered {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.status-partial {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.status-uncovered {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- Time Allocation / Team & Productivity Tab Styles --- */
.allocation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .allocation-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}
.allocation-member-card {
  background: var(--bg-stat-box);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-fast);
}
.allocation-member-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-solid);
}
.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.member-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
}
.avatar-analista { background: var(--color-analista); }
.avatar-designer { background: var(--color-designer); }
.avatar-dev { background: var(--color-dev); }
.avatar-equipe { background: var(--color-equipe); }
.avatar-system { background: var(--color-system); }

.member-time-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.member-time-control input {
  width: 60px;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-weight: 600;
}
.member-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.member-task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: rgba(30, 71, 105, 0.03);
  border-radius: 4px;
}

/* Chart Simulator Styles */
.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.chart-sim-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 120px;
  padding-top: 1rem;
  border-bottom: 2px solid var(--border-color);
}
.chart-sim-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 0.5rem;
}
.chart-sim-bar {
  width: 24px;
  background: var(--brand-green);
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  transition: height 0.5s ease;
  min-height: 5px;
}
.chart-sim-bar-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.chart-sim-bar-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* --- System Topology Styles (rda.html) --- */
.topology-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(30, 71, 105, 0.05);
}
.topology-network {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  justify-items: center;
  align-items: center;
  position: relative;
  padding: 2rem 1rem;
  border-radius: 12px;
  background-image: radial-gradient(var(--canvas-grid-dot) 1px, transparent 1px);
  background-size: 16px 16px;
}
.topology-node {
  background: var(--bg-node);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  width: 140px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  position: relative;
  z-index: 2;
}
.topology-node:hover, .topology-node.active {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--brand-green);
  box-shadow: 0 8px 20px rgba(186, 218, 85, 0.25);
  background: var(--bg-node-hover);
}
.topology-node i {
  color: var(--brand-blue);
}
.topology-node.active i {
  color: var(--brand-green);
}
.topology-node h4 {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}
.topology-node span {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.topology-node-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-system);
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Módulo de Processos e Gestão de Equipe (equipe.html)
   ========================================================================== */

.process-layout {
  display: flex;
  gap: 1.5rem;
  align-items: stretch;
  height: calc(100vh - 290px);
  min-height: 450px;
  min-width: 0;
  position: relative; /* Para a bandeja flutuante de Nova Atividade */
}

.flowchart-canvas-container {
  flex: 1;
  position: relative;
  border: var(--canvas-container-border);
  border-radius: 16px;
  overflow: auto;
  background-color: var(--bg-canvas);
  box-shadow: var(--canvas-container-shadow);
  cursor: grab;
}

.flowchart-canvas-scroll-wrapper {
  position: relative;
  width: calc(1800px * var(--zoom-level, 1));
  height: calc(1000px * var(--zoom-level, 1));
  overflow: hidden;
}

.swimlanes-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  pointer-events: none;
  z-index: 1;
}

.swimlane-column {
  border-right: 2px dashed var(--swimlane-border-color);
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.swimlane-column:last-child {
  border-right: none;
}

.swimlane-header {
  font-family: 'Koho', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: fit-content;
  margin-bottom: 1rem;
  position: sticky;
  top: 1rem;
  z-index: 5;
}

#lane-descoberta {
  background: rgba(217, 119, 6, 0.045);
}
#lane-operacao {
  background: rgba(8, 145, 178, 0.045);
}
#lane-devops {
  background: rgba(21, 128, 61, 0.045);
}

body.dark-mode #lane-descoberta {
  background: rgba(245, 158, 11, 0.045);
}
body.dark-mode #lane-operacao {
  background: rgba(34, 211, 238, 0.045);
}
body.dark-mode #lane-devops {
  background: rgba(34, 197, 94, 0.045);
}

.flowchart-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1800px;
  height: 1000px;
  z-index: 2;
  overflow: visible;
  transform: scale(var(--zoom-level, 1));
  transform-origin: 0 0;
  background-image: 
    radial-gradient(var(--canvas-grid-dot) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

/* --- Zoom Controls --- */
.flowchart-zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(30, 71, 105, 0.15);
  border-radius: 30px;
  padding: 4px 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  z-index: 40;
  pointer-events: auto;
}

body.dark-mode .flowchart-zoom-controls {
  background: rgba(20, 29, 47, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.zoom-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-accent);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.zoom-btn:hover {
  background: rgba(var(--brand-green-rgb), 0.2);
  color: var(--brand-blue);
}

body.dark-mode .zoom-btn:hover {
  color: var(--brand-green);
  background: rgba(255, 255, 255, 0.05);
}

.zoom-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 44px;
  text-align: center;
  user-select: none;
}

.flowchart-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.flowchart-svg path {
  fill: none;
  stroke: var(--svg-line-color);
  stroke-width: 2.5;
  transition: stroke var(--transition-fast), stroke-width var(--transition-fast);
}

.flowchart-svg path.hovered {
  stroke: var(--color-active-glow);
  stroke-width: 3.5;
  filter: drop-shadow(0 0 4px rgba(var(--brand-green-rgb), 0.4));
}

.flowchart-node {
  position: absolute;
  background: var(--bg-node);
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  cursor: grab;
  user-select: none;
  z-index: 10;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.flowchart-node .resize-handle {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(30, 71, 105, 0.6) 50%);
  z-index: 25;
  display: none;
  pointer-events: auto;
  border-bottom-right-radius: 4px;
}

.flowchart-node.selected .resize-handle {
  display: block;
}

body.dark-mode .flowchart-node .resize-handle {
  background: linear-gradient(135deg, transparent 50%, rgba(186, 218, 85, 0.8) 50%);
}

.flowchart-node:active {
  cursor: grabbing;
}

.connection-handle {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-green);
  color: #111111;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: crosshair;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  border: 1.5px solid var(--border-color);
  pointer-events: auto;
}

.flowchart-node.selected .connection-handle {
  display: flex;
}

.connection-handle:hover {
  background: var(--color-active-glow);
  transform: translateY(-50%) scale(1.25);
  box-shadow: 0 2px 10px rgba(var(--brand-green-rgb), 0.5);
}

.flowchart-node.type-decision .connection-handle {
  transform: translateY(-50%) rotate(-45deg);
}

.flowchart-node.type-decision .connection-handle:hover {
  transform: translateY(-50%) rotate(-45deg) scale(1.25);
}

.temp-drag-path {
  pointer-events: none;
}

.flowchart-node:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  border-color: var(--border-hover);
}

.flowchart-node.selected {
  border-color: var(--color-active-glow) !important;
  box-shadow: 0 0 0 3px rgba(var(--brand-green-rgb), 0.25), 0 8px 20px rgba(0,0,0,0.15) !important;
  transform: translateY(-2px) scale(1.02);
  z-index: 15;
}

/* Tipos de Nós */
.flowchart-node.type-process {
  min-width: 180px;
  max-width: 280px;
  width: max-content;
  height: auto;
  min-height: 80px;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.flowchart-node.type-start,
.flowchart-node.type-end {
  min-width: 80px;
  min-height: 80px;
  max-width: 130px;
  width: max-content;
  height: max-content;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 1rem;
  text-align: center;
}

.flowchart-node.type-end {
  border-style: double;
  border-width: 4px;
}

.flowchart-node.type-decision {
  min-width: 110px;
  min-height: 110px;
  width: max-content;
  height: max-content;
  aspect-ratio: 1 / 1;
  transform: rotate(45deg);
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flowchart-node.type-decision:hover {
  transform: rotate(45deg) translate(-2px, -2px) scale(1.02);
}

.flowchart-node.type-decision.selected {
  transform: rotate(45deg) translate(-2px, -2px) scale(1.02);
}

.flowchart-node.type-decision .node-content-wrapper {
  transform: rotate(-45deg);
  text-align: center;
  width: max-content;
  max-width: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Cores por swimlane no nó */
.flowchart-node.lane-descoberta {
  border-left: 5px solid var(--color-analista);
}
.flowchart-node.lane-operacao {
  border-left: 5px solid var(--color-dev);
}
.flowchart-node.lane-devops {
  border-left: 5px solid var(--color-equipe);
}

.flowchart-node.type-decision.lane-descoberta {
  border: 2px solid var(--color-analista);
}
.flowchart-node.type-decision.lane-operacao {
  border: 2px solid var(--color-dev);
}
.flowchart-node.type-decision.lane-devops {
  border: 2px solid var(--color-equipe);
}

.flowchart-node.type-start.lane-descoberta,
.flowchart-node.type-start.lane-operacao,
.flowchart-node.type-start.lane-devops,
.flowchart-node.type-end.lane-descoberta,
.flowchart-node.type-end.lane-operacao,
.flowchart-node.type-end.lane-devops {
  border-width: 2.5px;
}
.flowchart-node.type-start.lane-descoberta { border-color: var(--color-analista); }
.flowchart-node.type-start.lane-operacao { border-color: var(--color-dev); }
.flowchart-node.type-start.lane-devops { border-color: var(--color-equipe); }
.flowchart-node.type-end.lane-descoberta { border-color: var(--color-analista); }
.flowchart-node.type-end.lane-operacao { border-color: var(--color-dev); }
.flowchart-node.type-end.lane-devops { border-color: var(--color-equipe); }

/* Conteúdo do Nó */
.node-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.25;
  display: block;
  overflow: visible;
}

.flowchart-node.type-start .node-title,
.flowchart-node.type-end .node-title {
  font-size: 0.7rem;
  margin-bottom: 0;
}

#flow-arrow path {
  fill: var(--svg-arrow-color) !important;
}
#flow-arrow-hover path {
  fill: #BADA55 !important;
}

.node-owner {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.flowchart-editor-sidebar {
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  width: 380px;
  max-width: 90vw;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  z-index: 200;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity var(--transition-normal), transform var(--transition-normal), left var(--transition-normal), right var(--transition-normal);
  overflow-y: auto;
  
  /* Inicialmente oculta */
  opacity: 0;
  pointer-events: none;
}

.flowchart-editor-sidebar.float-left {
  left: 1rem;
  right: auto;
  transform: scale(0.95);
}

.flowchart-editor-sidebar.float-right {
  right: 1rem;
  left: auto;
  transform: scale(0.95);
}

.flowchart-editor-sidebar.active {
  opacity: 1;
  pointer-events: auto;
}

.flowchart-editor-sidebar.active.float-left {
  transform: scale(1);
}

.flowchart-editor-sidebar.active.float-right {
  transform: scale(1);
}

/* Membros da Equipe */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  position: relative;
  transition: all var(--transition-fast);
}

.member-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.member-card-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.75rem;
  width: 100%;
}

.member-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 6px 15px rgba(0,0,0,0.05);
}

.member-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Koho', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.member-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Cores das Badges de Equipe */
.role-sm { background: rgba(124, 58, 237, 0.1); color: var(--color-designer); border: 1px solid rgba(124, 58, 237, 0.2); }
.role-po { background: rgba(217, 119, 6, 0.1); color: var(--color-analista); border: 1px solid rgba(217, 119, 6, 0.2); }
.role-tl { background: rgba(8, 145, 178, 0.1); color: var(--color-dev); border: 1px solid rgba(8, 145, 178, 0.2); }
.role-an { background: rgba(236, 72, 153, 0.1); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.2); }
.role-arq { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.role-ux { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.role-llm { background: rgba(79, 70, 229, 0.1); color: var(--color-system); border: 1px solid rgba(79, 70, 229, 0.2); }

.member-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.member-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Dashboard de Saúde */
.team-health-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.team-health-indicator.health-ok {
  background: rgba(21, 128, 61, 0.08);
  color: var(--color-equipe);
  border-color: rgba(21, 128, 61, 0.15);
}

.team-health-indicator.health-warning {
  background: rgba(217, 119, 6, 0.08);
  color: var(--color-analista);
  border-color: rgba(217, 119, 6, 0.15);
}

.health-role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.health-role-item.checked {
  border-color: rgba(21, 128, 61, 0.25);
  background: rgba(21, 128, 61, 0.02);
}

.health-role-item.checked i {
  color: var(--color-equipe);
}

.health-role-item.missing {
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.02);
  color: var(--text-secondary);
}

.health-role-item.missing i {
  color: var(--color-analista);
}

/* Visibilidade das abas (Tabs) */
.roadmap-tab-panel {
  display: none;
}

.roadmap-tab-panel.active {
  display: block;
}

/* Cards de Responsabilidade dos Papéis */
.roles-descriptions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.role-desc-card {
  background: rgba(30, 71, 105, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: all var(--transition-fast);
}

body.dark-mode .role-desc-card {
  background: rgba(255, 255, 255, 0.01);
}

.role-desc-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 6px 15px rgba(0,0,0,0.04);
  background: var(--bg-card);
}

.role-desc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.role-desc-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Custom Vue-like Multiselect Component */
.custom-multiselect {
  position: relative;
  width: 100%;
}

.multiselect-select {
  display: flex;
  align-items: center;
  min-height: 40px;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 40px 6px 8px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.multiselect-select:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 10px rgba(186, 218, 85, 0.2);
}

.multiselect-tags-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.multiselect-placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding-left: 4px;
  user-select: none;
}

.multiselect-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  pointer-events: none;
}

.custom-multiselect.active .multiselect-caret {
  transform: translateY(-50%) rotate(180deg);
}

/* Dropdown styling */
.multiselect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 4px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: none;
  padding: 4px;
}

.custom-multiselect.active .multiselect-dropdown {
  display: block;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.multiselect-option:hover {
  background: var(--bg-main);
  color: var(--text-primary);
}

.multiselect-option.selected {
  background: rgba(var(--brand-green-rgb), 0.12);
  color: var(--text-primary);
  font-weight: 500;
}

.role-option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.multiselect-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  transition: opacity var(--transition-fast);
}

.multiselect-tag:hover {
  opacity: 0.95;
}

.multiselect-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

.multiselect-tag-remove:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Global Selection Color Style */
::selection {
  background-color: rgba(186, 218, 85, 0.25);
  color: var(--text-primary);
}

/* Custom Close Button for editor sidebar */
.close-editor-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.close-editor-btn:hover {
  background: rgba(186, 218, 85, 0.15);
  color: var(--text-primary);
}

body.dark-mode .close-editor-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Customized Selects inside form-group */
.form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

body.dark-mode .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.form-group select:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 10px rgba(186, 218, 85, 0.2);
}

/* --- Process & Rituais Page Styles --- */
.process-doc-layout, .papeis-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 992px) {
  .process-doc-layout, .papeis-layout {
    grid-template-columns: 1fr;
  }
}

.rituais-list, .papeis-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.ritual-list-item, .papeis-list-item {
  background: var(--bg-prereq);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.ritual-list-item:hover, .papeis-list-item:hover {
  background: var(--bg-prereq-hover);
  border-color: var(--border-hover);
  transform: translateX(2px);
}

.ritual-list-item.active, .papeis-list-item.active {
  background: rgba(var(--color-primary-rgb), 0.06);
  border-color: var(--brand-green);
  box-shadow: 0 4px 12px rgba(186, 218, 85, 0.15);
}

body.dark-mode .ritual-list-item.active, body.dark-mode .papeis-list-item.active {
  background: rgba(255, 255, 255, 0.04);
}

.ritual-list-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-accent);
}

.ritual-list-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.papeis-list-item {
  flex-direction: row;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-accent);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.rule-card {
  position: relative;
}

.rule-card .btn-delete-rule {
  opacity: 0.3;
}

.rule-card:hover .btn-delete-rule {
  opacity: 1;
}

.rule-card .btn-delete-rule:hover {
  color: #ef4444 !important;
}

/* Custom Textareas inside form groups */
.form-group textarea {
  font-family: inherit;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 10px rgba(186, 218, 85, 0.2);
}

/* --- Canvas Wrapper & Fullscreen --- */
.flowchart-outer-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.process-layout.fullscreen-active {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: var(--bg-body, #0a0f1d);
  padding: 24px;
  box-sizing: border-box;
}

body.dark-mode .process-layout.fullscreen-active {
  background: #090d16;
}

/* Custom expectations textarea styling - auto growing with no scrollbar */
.edit-exp-textarea {
  overflow: hidden !important;
  resize: none !important;
}
