@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:       #f7f7f5;
  --surface:  #fff;
  --border:   #e8e8e4;
  --border-2: #d4d4cc;
  --text:     #1a1a18;
  --text-2:   #6b6b66;
  --text-3:   #a0a09a;
  --accent:   #2563eb;
  --accent-2: #1d4ed8;
  --ok:       #16a34a;
  --warn:     #d97706;
  --err:      #dc2626;
  --radius:   10px;
  --radius-lg:16px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.screen { min-height: 100vh; }

@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

.hidden { display: none !important; }

/* ── kbd ─────────────────────────────────────────────────────────────────── */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  font-family: 'DM Mono', ui-monospace, monospace;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  color: var(--text-2);
  font-weight: 500;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--bg); }

.btn-danger {
  background: transparent;
  color: var(--err);
  border-color: #fca5a5;
}
.btn-danger:hover { background: #fef2f2; }

/* ── Tela 1 ──────────────────────────────────────────────────────────────── */
.t1-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 5rem 1.25rem;
}

.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
  user-select: none;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: #eff6ff;
}

.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* ── Session items ───────────────────────────────────────────────────────── */
.session-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: border-color 0.12s;
  margin-bottom: 0.5rem;
}
.session-item:hover { border-color: var(--accent); }
.session-name  { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.session-meta  { font-size: 0.75rem; color: var(--text-3); margin-top: 0.1rem; }
.session-action { font-size: 0.75rem; color: var(--accent); white-space: nowrap; flex-shrink: 0; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
}

/* ── Tela 2 ──────────────────────────────────────────────────────────────── */
.t2-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  overflow: hidden;
}
.t2-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.t2-main {
  overflow-y: auto;
  background: var(--bg);
  padding: 1.5rem;
}
.t2-panel {
  border-left: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  overflow-y: auto;
}

.sidebar-item { border-left: 2px solid transparent; transition: background 0.1s; }
.drop-active  { background: #eff6ff !important; }

/* ── Edit card ───────────────────────────────────────────────────────────── */
.edit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.edit-row {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}
.edit-row:last-child { margin-bottom: 0; }
.edit-label { font-size: 0.75rem; color: var(--text-3); }
.edit-field {
  width: 100%;
  font-size: 0.8125rem;
  font-family: 'DM Mono', ui-monospace, monospace;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.625rem;
  background: var(--bg);
  color: var(--text);
  resize: none;
  transition: border-color 0.12s;
  line-height: 1.5;
}
.edit-field:focus { outline: none; border-color: var(--accent); background: var(--surface); }

/* ── Tela 3 ──────────────────────────────────────────────────────────────── */
.t3-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}
.t3-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.t3-dropzone {
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.12s;
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  margin: 1rem;
  user-select: none;
}
.t3-dropzone:hover, .t3-dropzone.drag-over {
  background: #eff6ff;
  border-color: var(--accent);
}
.t3-log {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  background: #0f172a;
  color: #86efac;
  border-radius: var(--radius);
  padding: 1rem;
  height: 8rem;
  overflow-y: auto;
  white-space: pre;
  margin-bottom: 1rem;
}

/* ── Tela 4 ──────────────────────────────────────────────────────────────── */
.t4-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 5rem 1.25rem;
  text-align: center;
}
.t4-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 2rem 0;
}
.t4-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
}
.t4-stat-n     { font-size: 2rem; font-weight: 700; color: var(--text); }
.t4-stat-label { font-size: 0.75rem; color: var(--text-2); margin-top: 0.25rem; }

.t4-download {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color 0.12s;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: var(--text);
}
.t4-download:hover { border-color: var(--border-2); }
.t4-download.primary {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
}
.t4-download.primary:hover { background: #dbeafe; }
.t4-download-title { font-size: 0.875rem; font-weight: 500; }
.t4-download-sub   { font-size: 0.75rem; opacity: 0.7; margin-top: 0.125rem; }

/* ── Badge ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
}
