/* Share AI · Tema dark mobile-friendly */
:root {
  --bg: #0f172a;
  --bg-card: #1f2937;
  --bg-elev: #111827;
  --border: #374151;
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --gold: #c8964a;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: rgba(200,150,74,0.12);
  color: var(--gold);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand .logo { font-size: 1.4rem; }
.brand .brand-by { color: var(--text-dim); font-size: 0.78rem; font-weight: 400; }
.nav { display: flex; gap: 0.4rem; align-items: center; }
.nav a {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
}
.nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); text-decoration: none; }
.nav a.btn-novo {
  background: var(--gold);
  color: #000;
}
.nav a.logout { color: var(--red); }

/* ── FLASHES ─────────────────────────────────────────────────── */
.flashes { padding: 0 1rem; margin-top: 0.5rem; }
.flash {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
.flash-success { background: rgba(34,197,94,0.12); border: 1px solid var(--green); color: #4ade80; }
.flash-error { background: rgba(239,68,68,0.12); border: 1px solid var(--red); color: #f87171; }

/* ── CONTAINER ───────────────────────────────────────────────── */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem;
}

/* ── HERO + STATS ────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.hero h1 { margin: 0; font-size: 1.5rem; }
.stats { display: flex; gap: 0.5rem; }
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  text-align: center;
  min-width: 80px;
}
.stat-num { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.stat-unit { font-size: 0.6em; color: var(--text-dim); margin-left: 0.15em; }
.stat-lbl { font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.5px; text-transform: uppercase; }

/* ── WORKSPACE LIST ──────────────────────────────────────────── */
.ws-list { display: flex; flex-direction: column; gap: 0.7rem; }
.ws-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  transition: border-color 0.2s;
}
.ws-card.rodando { border-color: var(--green); }
.ws-card:hover { border-color: var(--gold); }
.ws-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.ws-title { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 180px; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.verde { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.6); }
.dot.cinza { background: #6b7280; }
.ws-nome { font-weight: 700; font-size: 1.05rem; }
.ws-status {
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}
.ws-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.ws-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.ws-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.ws-meta .meta { white-space: nowrap; }

/* ── BOTÕES ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn:hover { background: rgba(255,255,255,0.05); }
.btn-primary { background: var(--gold); color: #000; border-color: var(--gold); }
.btn-primary:hover { background: #d4a55c; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-start { background: var(--green); color: #fff; border-color: var(--green); }
.btn-start:hover { background: #16a34a; }
.btn-stop { background: rgba(239,68,68,0.12); color: var(--red); border-color: var(--red); }
.btn-stop:hover { background: var(--red); color: #fff; }
.btn-del { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-del:hover { background: rgba(239,68,68,0.12); color: var(--red); border-color: var(--red); }
.btn-terminal { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.btn-terminal:hover { background: #2563eb; text-decoration: none; }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}
.empty p { margin-bottom: 1rem; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-card, .login-card {
  max-width: 480px;
  margin: 2rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}
.form-card h1, .login-card h1 { margin: 0 0 0.6rem 0; font-size: 1.4rem; }
.muted { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 1.2rem; }
form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}
form input, form textarea, form select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 0.8rem;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
form textarea { resize: vertical; min-height: 60px; font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 0.85rem; }
form input:focus, form textarea:focus { outline: none; border-color: var(--gold); }
.hint { display: block; font-size: 0.72rem; color: var(--text-dim); font-weight: 400; margin-top: 0.25rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* ── TERMINAL PAGE ───────────────────────────────────────────── */
.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.6rem;
}
.term-info { display: flex; align-items: center; gap: 0.5rem; }
.term-actions { display: flex; gap: 0.4rem; }
.terminal-frame {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 400px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.terminal-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 0.6rem; }
  .ws-actions { width: 100%; justify-content: stretch; }
  .ws-actions .btn { flex: 1; min-width: auto; }
  .terminal-frame { height: calc(100vh - 250px); min-height: 350px; }
  .nav a { padding: 0.35rem 0.55rem; font-size: 0.78rem; }
  .nav .brand-by { display: none; }
  .hero h1 { font-size: 1.2rem; }
  .stat { padding: 0.5rem 0.7rem; min-width: 70px; }
  .stat-num { font-size: 1.15rem; }
}
