* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    gap: 1px;
    background: #2d2d2d;
}

/* Left Column: Agent List + Tasks */
.left-column {
    width: 350px;
    background: #252526;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3e3e42;
}

.agents-section {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #3e3e42;
    min-height: 0;
}

.panel-header {
    padding: 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #cccccc;
}

.search-box {
    padding: 8px;
    border-bottom: 1px solid #3e3e42;
}

.search-box input {
    width: 100%;
    padding: 6px 8px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 3px;
    color: #cccccc;
    font-size: 13px;
}

.search-box input:focus {
    outline: 1px solid #007acc;
    border-color: #007acc;
}

.agent-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    min-height: 0;
}

.agent-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 3px;
    margin-bottom: 2px;
    transition: background 0.1s;
}

.agent-item:hover {
    background: #2a2d2e;
}

.agent-item.active {
    background: #094771;
}

.agent-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #cccccc;
    margin-bottom: 2px;
}

.agent-item-type {
    font-size: 11px;
    color: #858585;
    text-transform: uppercase;
}

.agent-item-purpose {
    font-size: 11px;
    color: #858585;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Middle Column: Code/State Viewer */
.middle-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
}

.viewer-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.viewer-controls select {
    padding: 4px 8px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 3px;
    color: #cccccc;
    font-size: 12px;
}

.version-selector {
    padding: 8px 12px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    gap: 8px;
    align-items: center;
}

.version-selector label {
    font-size: 12px;
    color: #858585;
}

.version-selector select {
    flex: 1;
    padding: 4px 8px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 3px;
    color: #cccccc;
    font-size: 12px;
}

.file-viewer {
    flex: 1;
    overflow: auto;
    position: relative;
}

.file-content {
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
    color: #d4d4d4;
}

.file-content pre {
    margin: 0;
    font-family: inherit;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: #858585;
    font-size: 14px;
}

/* Diff Viewer */
.diff-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #3e3e42;
}

.diff-header {
    padding: 8px 12px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #858585;
}

.diff-content {
    flex: 1;
    display: flex;
    overflow: auto;
}

.diff-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3e3e42;
}

.diff-side:last-child {
    border-right: none;
}

.diff-side-header {
    padding: 8px 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #3e3e42;
    font-size: 12px;
    font-weight: 600;
    color: #cccccc;
}

.diff-text {
    flex: 1;
    padding: 16px;
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
    overflow: auto;
    background: #1e1e1e;
    color: #d4d4d4;
}

.diff-line {
    padding: 2px 0;
}

.diff-line.added {
    background: #1e3a1e;
    color: #4ec9b0;
}

.diff-line.removed {
    background: #3a1e1e;
    color: #f48771;
}

.diff-line.modified {
    background: #3a3a1e;
}

.diff-line.equal {
    color: #858585;
}

/* Right Column: Development */
.right-column {
    width: 400px;
    background: #252526;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #3e3e42;
}

.dev-form {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    color: #858585;
    margin-bottom: 4px;
}

.form-group select,
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 6px 8px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 3px;
    color: #cccccc;
    font-size: 13px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
    font-family: inherit;
    line-height: 1.5;
}

.form-group:first-of-type {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group:first-of-type textarea {
    flex: 1;
    min-height: 0;
}

.form-group input[type="checkbox"] {
    margin-right: 6px;
}

.btn-primary,
.btn-secondary,
.btn-icon {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.1s;
}

.btn-primary {
    background: #007acc;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #005a9e;
}

.btn-secondary {
    background: #3c3c3c;
    color: #cccccc;
    border: 1px solid #464647;
}

.btn-secondary:hover {
    background: #464647;
}

.btn-icon {
    background: transparent;
    color: #cccccc;
    padding: 4px 8px;
    font-size: 14px;
}

.btn-icon:hover {
    background: #3c3c3c;
}

.tasks-section {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    min-height: 0;
    border-top: 1px solid #3e3e42;
}

.tasks-section:first-of-type {
    border-top: none;
}

.tasks-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
    margin-bottom: 8px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    padding: 10px;
    background: #2d2d2d;
    border: 1px solid #3e3e42;
    border-radius: 3px;
}

.task-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.task-item-agent {
    font-size: 12px;
    font-weight: 600;
    color: #cccccc;
}

.task-item-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
}

.task-item-status.starting {
    background: #4a5568;
    color: #e2e8f0;
}

.task-item-status.running {
    background: #2d5016;
    color: #c6f6d5;
}

.task-item-status.completed {
    background: #1a365d;
    color: #bee3f8;
}

.task-item-status.failed {
    background: #742a2a;
    color: #fed7d7;
}

.task-item-status.partial {
    background: #5a4a1a;
    color: #f6e05e;
}

.task-item.dismissed {
    opacity: 0.7;
    border-style: dashed;
}

.task-item-meta {
    font-size: 10px;
    color: #858585;
    margin-bottom: 4px;
}

.task-item-branch {
    font-size: 11px;
    color: #858585;
    margin-bottom: 4px;
}

.task-item-spec {
    font-size: 11px;
    color: #858585;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.task-item-id {
    font-size: 10px;
    color: #858585;
    font-family: monospace;
}

.task-progress {
    margin-top: 6px;
    margin-bottom: 6px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #3c3c3c;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: #007acc;
    transition: width 0.3s;
}

.progress-text {
    font-size: 10px;
    color: #858585;
}

.progress-bar-large {
    width: 100%;
    height: 8px;
    background: #3c3c3c;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-stats {
    font-size: 12px;
    color: #cccccc;
}

.task-item-actions {
    margin-top: 6px;
    display: flex;
    gap: 4px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 11px;
    background: #3c3c3c;
    border: 1px solid #464647;
    border-radius: 2px;
    color: #cccccc;
    cursor: pointer;
}

.btn-small:hover {
    background: #464647;
}

.btn-warning {
    background: #d69e2e;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #b7791f;
}

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

.section-header h3 {
    margin: 0;
}

.logs-container {
    max-height: 500px;
    overflow-y: auto;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    padding: 12px;
}

.logs-content {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
    margin: 0;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background: #252526;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 12px 16px;
    background: #2d2d2d;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 14px;
    color: #cccccc;
}

.modal-close {
    background: none;
    border: none;
    color: #cccccc;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.task-detail-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #3e3e42;
}

.task-detail-section:last-child {
    border-bottom: none;
}

.task-detail-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
    margin-bottom: 8px;
}

.status-info {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #858585;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.status-badge.discovering,
.status-badge.planning,
.status-badge.generating,
.status-badge.reviewing,
.status-badge.testing,
.status-badge.deploying {
    background: #4a5568;
    color: #e2e8f0;
}

.status-badge.completed {
    background: #1a365d;
    color: #bee3f8;
}

.status-badge.failed {
    background: #742a2a;
    color: #fed7d7;
}

.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workflow-step {
    padding: 10px;
    background: #2d2d2d;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    margin-bottom: 8px;
}

.workflow-step.completed {
    border-color: #1a365d;
}

.workflow-step.failed {
    border-color: #742a2a;
}

.workflow-step.in_progress {
    border-color: #4a5568;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px;
    border-radius: 2px;
    transition: background 0.1s;
}

.step-header:hover {
    background: #3c3c3c;
}

.step-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.step-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-expand-icon {
    font-size: 10px;
    color: #858585;
    transition: transform 0.2s;
    width: 12px;
    display: inline-block;
}

.step-agent-name {
    font-size: 11px;
    color: #858585;
    font-style: italic;
}

.step-timestamp {
    font-size: 10px;
    color: #858585;
    font-family: monospace;
}

.step-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #3e3e42;
}

.step-info-item {
    margin-bottom: 12px;
    font-size: 12px;
}

.step-info-item strong {
    color: #cccccc;
    display: block;
    margin-bottom: 4px;
}

.step-data {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 2px;
    padding: 8px;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #d4d4d4;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    margin: 4px 0;
}

.step-agent-list {
    margin: 4px 0 0 20px;
    padding: 0;
    list-style: disc;
    color: #858585;
}

.step-agent-list li {
    margin: 2px 0;
    font-size: 11px;
}

.step-logs-container {
    margin-top: 12px;
}

.step-logs {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 2px;
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.step-logs-content {
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #d4d4d4;
    white-space: pre-wrap;
    margin: 0;
    line-height: 1.4;
}

.step-name {
    font-size: 12px;
    font-weight: 600;
    color: #cccccc;
    text-transform: capitalize;
}

.step-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
}

.step-status.completed {
    background: #1a365d;
    color: #bee3f8;
}

.step-status.failed {
    background: #742a2a;
    color: #fed7d7;
}

.step-agent {
    font-size: 11px;
    color: #858585;
    margin-bottom: 4px;
}

.step-result {
    font-size: 11px;
    color: #4ec9b0;
    font-family: monospace;
    margin-top: 4px;
}

.step-error {
    font-size: 11px;
    color: #f48771;
    margin-top: 4px;
}

.step-warning {
    font-size: 11px;
    color: #f6e05e;
    background: #5a4a1a;
    padding: 4px 8px;
    border-radius: 2px;
    margin-top: 4px;
}

.workflow-step.warning {
    border-color: #5a4a1a;
}

/* Task Communication Styles */
.task-communication {
    margin-top: 15px;
}

.clarifying-questions {
    background: #2a3a4a;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.clarifying-questions ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.clarifying-questions li {
    margin: 5px 0;
    color: #e0e0e0;
}

.conversation-container {
    max-height: 300px;
    overflow-y: auto;
    background: #1a1a1a;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #333;
}

.conversation-message {
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 4px;
    background: #252525;
}

.conversation-message.user {
    background: #2a3a4a;
    border-left: 3px solid #4a9eff;
}

.conversation-message.agent {
    background: #2a2a3a;
    border-left: 3px solid #9a4aff;
}

.message-header {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #aaa;
    margin-bottom: 5px;
}

.message-role {
    font-weight: bold;
    color: #fff;
}

.message-time {
    color: #888;
}

.message-mode {
    color: #4a9eff;
    font-style: italic;
}

.message-content {
    color: #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.pending-messages {
    margin-top: 15px;
    padding: 10px;
    background: #3a2a1a;
    border-radius: 4px;
    border: 1px solid #5a4a1a;
}

.pending-message {
    margin: 8px 0;
    padding: 8px;
    background: #2a1a0a;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.injected-badge, .pending-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: bold;
}

.injected-badge {
    background: #2a5a2a;
    color: #8aff8a;
}

.pending-badge {
    background: #5a4a1a;
    color: #f6e05e;
}

.message-input-container {
    margin-top: 15px;
}

.message-input {
    width: 100%;
    padding: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
    margin-bottom: 10px;
}

.message-options {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 12px;
}

.message-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #aaa;
    cursor: pointer;
}

.message-options input[type="radio"] {
    cursor: pointer;
}

.discovered-agents {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agent-match {
    padding: 6px 8px;
    background: #2d2d2d;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-name {
    font-size: 12px;
    color: #cccccc;
}

.relevance-score {
    font-size: 11px;
    color: #858585;
    font-family: monospace;
}

.task-notes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.note-item {
    padding: 8px;
    background: #2d2d2d;
    border-left: 2px solid #007acc;
    border-radius: 2px;
}

.note-time {
    font-size: 10px;
    color: #858585;
    margin-bottom: 2px;
}

.note-step {
    font-size: 10px;
    color: #007acc;
    font-weight: 600;
    margin-bottom: 4px;
}

.note-message {
    font-size: 12px;
    color: #cccccc;
}

.task-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    padding: 10px;
    background: #2d2d2d;
    border: 1px solid #3e3e42;
    border-radius: 3px;
}

.result-item strong {
    font-size: 12px;
    color: #cccccc;
    display: block;
    margin-bottom: 6px;
}

.result-content {
    font-size: 11px;
    color: #4ec9b0;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    margin: 0;
    padding: 8px;
    background: #1e1e1e;
    border-radius: 2px;
}

.loading {
    padding: 20px;
    text-align: center;
    color: #858585;
    font-size: 13px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}
