@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --ink: #e8f4ee;
  --muted: #8ca299;
  --line: #203e36;
  --line-bright: #2f5a4e;
  --canvas: #071510;
  --panel: #0d221b;
  --panel-card: #122b22;
  --accent: #b5fa75;
  --accent-glow: rgba(181, 250, 117, 0.25);
  --blue: #7dd3fc;
  --warning: #facc15;
  --danger: #f87171;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 80% 0, #153c30 0, transparent 35rem), var(--canvas);
  color: var(--ink);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
}

main {
  max-width: 1200px;
  margin: auto;
  padding: 40px 24px 80px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}

.eyebrow {
  font: 600 11px 'DM Mono', monospace;
  letter-spacing: .18em;
  color: var(--accent);
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(28px, 4.5vw, 50px);
  font-weight: 700;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.04em;
}
h1 span { color: var(--accent); }

button, input { font: inherit; }

.connections {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-conn {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.btn-conn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-conn.connected {
  border-color: rgba(181, 250, 117, 0.4);
  background: rgba(181, 250, 117, 0.08);
  color: var(--accent);
}

.terminal {
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: #05100c;
  font: 12.5px 'DM Mono', monospace;
}

.bar {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: #0f241d;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}
.bar i { width: 8px; height: 8px; border-radius: 50%; background: #3b564e; }
.bar i:nth-child(1) { background: #f87171; }
.bar i:nth-child(2) { background: #fbbf24; }
.bar i:nth-child(3) { background: #4ade80; }
.bar span { margin-left: 8px; }

.log {
  height: 110px;
  overflow-y: auto;
  padding: 12px 16px 4px;
  color: #c4d8d0;
}
.log div { margin-bottom: 5px; line-height: 1.4; }
.log .command { color: var(--blue); }
.log .ok { color: var(--accent); }
.log .error { color: var(--danger) !important; }

#command {
  display: flex;
  padding: 6px 16px 10px;
  gap: 8px;
  color: var(--accent);
  border-top: 1px solid rgba(255,255,255,0.04);
}
#command input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  flex: 1;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-top: 0;
  overflow: hidden;
  background: rgba(13, 34, 27, 0.85);
}

.explorer {
  display: flex;
  flex-direction: column;
  min-height: 380px;
  border-right: 1px solid var(--line);
}
.explorer:last-child {
  border-right: 0;
}

.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font: 600 12px 'DM Mono', monospace;
  background: rgba(8, 22, 17, 0.6);
}
.title span {
  color: var(--muted);
  font-weight: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}
.title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sm {
  background: transparent;
  border: 1px solid var(--line-bright);
  color: var(--ink);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: all .15s;
}
.btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-accent {
  background: rgba(181, 250, 117, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.btn-accent:hover {
  background: var(--accent);
  color: #081711;
}

.files {
  flex: 1;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}
.files > p {
  color: var(--muted);
  padding: 18px;
  font-size: 13px;
  margin: 0;
  text-align: center;
}

.file, .dropbox-file {
  width: 100%;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 3px;
  transition: background .15s;
}
.file:hover, .dropbox-file:hover {
  background: #19382e;
}
.file.selected, .dropbox-file.selected {
  background: rgba(181, 250, 117, 0.12);
  border-color: rgba(181, 250, 117, 0.35);
}
.file span, .dropbox-file span {
  font-size: 14px;
}
.file b, .dropbox-file b {
  font-weight: 500;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file small, .dropbox-file small {
  color: var(--muted);
  font: 11px 'DM Mono', monospace;
}

.source-bar, .target-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #081813;
  border-top: 1px solid var(--line);
  font-size: 12px;
  gap: 12px;
}
.source-bar span, .target-info span {
  color: var(--muted);
  margin-right: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
}
.source-bar b, .target-info b {
  color: var(--accent);
  font-weight: 600;
}

.action-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #081a14;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  gap: 20px;
  flex-wrap: wrap;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.toggle-label input {
  cursor: pointer;
  accent-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  color: #071711;
  border: 0;
  border-radius: 7px;
  padding: 11px 24px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: -0.01em;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* DASHBOARD & TASK CARDS */
.dashboard {
  margin-top: 32px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.dashboard-header h2 {
  font-size: 14px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.1em;
  margin: 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  background: #1b382f;
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.empty-tasks {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.task-card {
  background: var(--panel-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s;
}
.task-card.running {
  border-color: rgba(181, 250, 117, 0.4);
  box-shadow: 0 4px 18px rgba(0,0,0,0.2);
}
.task-card.complete {
  border-color: rgba(125, 211, 252, 0.3);
}
.task-card.failed, .task-card.cancelled {
  border-color: rgba(248, 113, 113, 0.3);
  opacity: 0.85;
}

.task-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.task-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  overflow: hidden;
}
.task-title span {
  color: var(--muted);
  font-weight: normal;
}
.task-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-status-tag {
  font: 600 10.5px 'DM Mono', monospace;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-running {
  background: rgba(181, 250, 117, 0.15);
  color: var(--accent);
  border: 1px solid rgba(181, 250, 117, 0.3);
}
.tag-complete {
  background: rgba(125, 211, 252, 0.15);
  color: var(--blue);
  border: 1px solid rgba(125, 211, 252, 0.3);
}
.tag-cancelled {
  background: rgba(250, 204, 21, 0.15);
  color: var(--warning);
  border: 1px solid rgba(250, 204, 21, 0.3);
}
.tag-failed {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-cancel {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--danger);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  transition: all .15s;
}
.btn-cancel:hover {
  background: var(--danger);
  color: #071711;
}

.meter {
  height: 6px;
  background: #1c3d33;
  border-radius: 8px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width .25s ease;
}
.meter span.complete { background: var(--blue); }
.meter span.cancelled { background: var(--warning); }
.meter span.failed { background: var(--danger); }

.task-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 11px 'DM Mono', monospace;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 6px;
}
.task-details b { color: var(--ink); }

@media(max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .explorer { border-right: 0; border-bottom: 1px solid var(--line); min-height: 280px; }
  header { flex-direction: column; align-items: flex-start; }
}
