/* === WORKSPACE RESET & LAYOUT === */
.ws-hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  z-index: 300;
}

.ws-hud-left { display: flex; align-items: center; gap: 1rem; }
.ws-hud-right { display: flex; align-items: center; gap: 0.75rem; }

.ws-hud-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--fg);
}

.ws-hud-rings {
  position: relative;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ws-hud-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.15);
}
.ws-hud-ring-1 {
  width: 32px; height: 32px;
  animation: hud-rotate 8s linear infinite;
}
.ws-hud-ring-2 {
  width: 22px; height: 22px;
  animation: hud-rotate 5s linear infinite reverse;
}
@keyframes hud-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.ws-hud-core-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: core-pulse 3s ease-in-out infinite;
  z-index: 1;
  position: relative;
}
@keyframes core-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.5); opacity: 0.4; }
}

.ws-hud-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}
.ws-hud-status-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: status-blink 2s ease-in-out infinite;
}
@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.ws-hud-btn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg-muted);
  transition: background 0.2s, color 0.2s;
}
.ws-hud-btn:hover { background: rgba(0, 229, 255, 0.12); color: var(--accent); }
.ws-hud-btn svg { display: block; }

/* === WORKSPACE BODY === */
.ws-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: 56px;
}

.ws-panels {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* === PANELS === */
.ws-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(0, 229, 255, 0.07);
}
.ws-panel:last-child { border-right: none; }

.ws-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.07);
  flex-shrink: 0;
}
.ws-panel-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.ws-panel-badge {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 229, 255, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
}
.ws-panel-add {
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg-muted);
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.ws-panel-add:hover { color: var(--accent); background: rgba(0, 229, 255, 0.06); }

.ws-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}
.ws-panel-content::-webkit-scrollbar { width: 3px; }
.ws-panel-content::-webkit-scrollbar-track { background: transparent; }
.ws-panel-content::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.1); border-radius: 2px; }

/* === LEFT PANEL — PROJECTS & BRIEFING === */
.ws-projects { padding: 8px 0; }
.ws-project-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.ws-project-item:hover { background: rgba(0, 229, 255, 0.04); }
.ws-project-item.active { background: rgba(0, 229, 255, 0.06); }
.ws-project-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.3);
  flex-shrink: 0;
}
.ws-project-item.active .ws-project-dot { background: var(--accent); }
.ws-project-name {
  font-size: 0.8rem;
  color: var(--fg-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-project-item.active .ws-project-name { color: var(--fg); }

.ws-briefing {
  margin: 10px 14px;
  padding: 12px;
  background: rgba(0, 229, 255, 0.03);
  border: 1px solid rgba(0, 229, 255, 0.08);
  border-radius: 8px;
}
.ws-briefing-time {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}
.ws-briefing-text {
  font-size: 0.78rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* === CENTER — CHAT === */
.ws-center {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(0, 229, 255, 0.07);
}

.ws-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ws-chat-messages::-webkit-scrollbar { width: 4px; }
.ws-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ws-chat-messages::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.1); border-radius: 2px; }

.ws-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.ws-chat-empty-icon {
  margin-bottom: 1rem;
  opacity: 0.3;
}
.ws-chat-empty p {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 220px;
}

.ws-chat-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
}
.ws-chat-typing-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing-wave 1.2s ease-in-out infinite;
}
.ws-chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.ws-chat-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-wave {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ws-chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px 8px;
}
.ws-chat-status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22c55e;
}
.ws-chat-status-text {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.ws-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(0, 229, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
.ws-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.ws-chat-input::placeholder { color: var(--fg-muted); opacity: 0.5; }
.ws-chat-input:focus {
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.04);
}
.ws-chat-submit {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.ws-chat-submit:hover { opacity: 0.9; }
.ws-chat-submit:active { transform: scale(0.95); }

/* === SLASH COMMAND DROPDOWN === */
.ws-cmd-dropdown {
  position: absolute;
  bottom: 60px;
  left: 14px;
  right: 14px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  z-index: 400;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.ws-cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(0, 229, 255, 0.05);
}
.ws-cmd-item:last-child { border-bottom: none; }
.ws-cmd-item:hover { background: rgba(0, 229, 255, 0.06); }
.ws-cmd-item-name {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg);
}
.ws-cmd-item-desc {
  font-size: 0.7rem;
  color: var(--fg-muted);
}

/* === RIGHT PANEL — TABS === */
.ws-right-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0, 229, 255, 0.07);
  flex-shrink: 0;
}
.ws-right-tab {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}
.ws-right-tab.active { color: var(--accent); }
.ws-right-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}

.ws-tab-panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.ws-tab-panel.active { display: flex; }

/* === TASKS === */
.ws-task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.ws-task-item:hover { background: rgba(0, 229, 255, 0.03); }
.ws-task-checkbox {
  width: 14px; height: 14px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.ws-task-item.done .ws-task-checkbox {
  background: rgba(0, 229, 255, 0.15);
  border-color: rgba(0, 229, 255, 0.3);
}
.ws-task-checkbox svg { display: none; }
.ws-task-item.done .ws-task-checkbox svg { display: block; }
.ws-task-body { flex: 1; min-width: 0; }
.ws-task-name {
  font-size: 0.8rem;
  color: var(--fg);
  margin-bottom: 3px;
  line-height: 1.4;
}
.ws-task-item.done .ws-task-name { text-decoration: line-through; color: var(--fg-muted); opacity: 0.6; }
.ws-task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-task-priority {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-task-priority-high { background: #ef4444; }
.ws-task-priority-med { background: var(--amber); }
.ws-task-priority-low { background: var(--accent); }
.ws-task-status {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ws-task-status-todo { color: var(--fg-muted); }
.ws-task-status-inprogress { color: var(--amber); }
.ws-task-status-done { color: var(--accent); }
.ws-task-delete {
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg-muted);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  flex-shrink: 0;
}
.ws-task-item:hover .ws-task-delete { opacity: 1; }
.ws-task-delete:hover { color: #ef4444; }

/* === KNOWLEDGE GRAPH === */
.ws-graph-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ws-graph-svg {
  width: 100%;
  height: 100%;
}
.ws-graph-node {
  cursor: pointer;
  transition: opacity 0.2s;
}
.ws-graph-node:hover { opacity: 0.75; }
.ws-graph-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  fill: var(--fg-muted);
  pointer-events: none;
}
.ws-graph-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 1.5rem;
}
.ws-graph-empty svg { opacity: 0.2; margin-bottom: 0.75rem; }
.ws-graph-empty p {
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* === DECISION ENGINE === */
.ws-decision-card {
  background: rgba(0, 229, 255, 0.03);
  border: 1px solid rgba(0, 229, 255, 0.1);
  border-radius: 8px;
  margin: 10px 14px;
  overflow: hidden;
}
.ws-decision-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ws-decision-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.ws-decision-body { padding: 10px 12px; }
.ws-decision-row {
  margin-bottom: 10px;
}
.ws-decision-row:last-child { margin-bottom: 0; }
.ws-decision-row-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.ws-decision-row-text {
  font-size: 0.78rem;
  color: var(--fg);
  line-height: 1.5;
}
.ws-decision-proscons {
  display: flex;
  gap: 8px;
}
.ws-decision-pro,
.ws-decision-con {
  flex: 1;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 0.7rem;
  line-height: 1.4;
}
.ws-decision-pro {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #4ade80;
}
.ws-decision-con {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.ws-decision-confidence {
  margin-top: 8px;
}
.ws-decision-confidence-bar {
  height: 4px;
  background: rgba(0, 229, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.ws-decision-confidence-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.ws-decision-confidence-label {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--fg-muted);
}

/* === BOTTOM BAR — PIPELINE === */
.ws-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 1.5rem;
  height: 56px;
  background: rgba(6, 11, 24, 0.9);
  border-top: 1px solid rgba(0, 229, 255, 0.08);
  flex-shrink: 0;
  position: relative;
}
.ws-pipeline-stage {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  position: relative;
  cursor: default;
}
.ws-pipeline-stage-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.2);
  transition: background 0.3s, box-shadow 0.3s;
}
.ws-pipeline-stage-name {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.3s;
}
.ws-pipeline-stage.active .ws-pipeline-stage-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: stage-pulse 2s ease-in-out infinite;
}
.ws-pipeline-stage.active .ws-pipeline-stage-name { color: var(--accent); }
@keyframes stage-pulse {
  0%, 100% { box-shadow: 0 0 6px var(--accent-glow); }
  50% { box-shadow: 0 0 14px var(--accent-glow); }
}
.ws-pipeline-connector {
  flex: 1;
  height: 1px;
  background: rgba(0, 229, 255, 0.08);
  min-width: 16px;
}
.ws-pipeline-connector.done {
  background: rgba(0, 229, 255, 0.25);
}

/* === APPROVAL GATE === */
.ws-approval {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 48px;
  background: rgba(245, 158, 11, 0.06);
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
}
.ws-approval.visible { display: flex; }
.ws-approval-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--amber);
}
.ws-approval-icon {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: approval-blink 1.5s ease-in-out infinite;
}
@keyframes approval-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.ws-approval-actions { display: flex; gap: 8px; }
.ws-approval-btn {
  padding: 6px 14px;
  border-radius: 5px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.ws-approval-btn:hover { opacity: 0.85; }
.ws-approval-btn-approve { background: var(--accent); color: var(--bg); }
.ws-approval-btn-edit { background: rgba(245, 158, 11, 0.15); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.ws-approval-btn-deny { background: rgba(255, 255, 255, 0.05); color: var(--fg-muted); }

/* === ACTION LOG === */
.ws-actionlog {
  display: none;
  flex-direction: column;
  gap: 0;
  max-height: 140px;
  overflow-y: auto;
  border-top: 1px solid rgba(0, 229, 255, 0.06);
  flex-shrink: 0;
}
.ws-actionlog.visible { display: flex; }
.ws-actionlog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.04);
}
.ws-actionlog-time {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--fg-muted);
  opacity: 0.6;
  flex-shrink: 0;
}
.ws-actionlog-text {
  font-size: 0.72rem;
  color: var(--fg-muted);
}
.ws-actionlog-text span { color: var(--accent); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .ws-panels {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .ws-panel { border-right: none; border-bottom: 1px solid rgba(0, 229, 255, 0.07); }
  .ws-panel:last-child { border-bottom: none; }
  .ws-right { display: none; }
}
