:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e38;
  --text: #e8e9ec;
  --muted: #9aa0ab;
  --accent: #d4af37;
  --danger: #c94b4b;
  --ok: #4bb17a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.screen { min-height: 100vh; }
.screen[hidden] { display: none; }

#login-screen { display: flex; align-items: center; justify-content: center; }
.login-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  width: 320px;
  text-align: center;
}
.login-box h1 { margin: 0 0 0.25rem; color: var(--accent); }
.subtitulo { color: var(--muted); font-size: 0.85rem; margin-top: 0; }
#login-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
input, textarea, select, button {
  font-family: inherit;
  font-size: 0.95rem;
}
#login-password {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
}
.error { color: var(--danger); font-size: 0.85rem; }

#app-screen { display: flex; flex-direction: column; height: 100vh; }
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border);
}
header h1 { font-size: 1.1rem; color: var(--accent); margin: 0; }
.cliente-selector { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
#cliente-select {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  padding: 0.4rem 0.6rem; border-radius: 6px;
}

#chat-log { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.msg { max-width: 75%; padding: 0.6rem 0.9rem; border-radius: 10px; line-height: 1.45; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #26304a; }
.msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); }
.msg .play-btn { margin-left: 0.5rem; cursor: pointer; opacity: 0.7; }

#propuestas-panel { padding: 0 1.5rem; }
.propuesta {
  border: 1px solid var(--accent); background: #1f1a0f; border-radius: 10px;
  padding: 0.9rem 1rem; margin-bottom: 0.75rem;
}
.propuesta h4 { margin: 0 0 0.4rem; color: var(--accent); font-size: 0.9rem; }
.propuesta pre { background: #0b0d11; padding: 0.6rem; border-radius: 6px; overflow-x: auto; font-size: 0.78rem; max-height: 220px; }
.propuesta .diff-old { color: #d97070; }
.propuesta .diff-new { color: #7fd97f; }
.propuesta-botones { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.propuesta-botones button { padding: 0.4rem 0.9rem; border-radius: 6px; border: none; cursor: pointer; }
.btn-confirmar { background: var(--ok); color: #06210f; font-weight: 600; }
.btn-rechazar { background: var(--danger); color: #2a0808; font-weight: 600; }
.propuesta-resultado { font-size: 0.8rem; margin-top: 0.5rem; color: var(--muted); }

.foto-tray { display: flex; gap: 0.5rem; padding: 0.5rem 1.5rem; flex-wrap: wrap; }
.foto-tray[hidden] { display: none; }
.foto-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.foto-thumb .quitar { position: absolute; top: 0; right: 0; background: rgba(0,0,0,0.6); color: #fff; border: none; cursor: pointer; font-size: 0.7rem; padding: 0 4px; }

#chat-form { display: flex; gap: 0.5rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--border); align-items: flex-end; }
#chat-form button { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 0.5rem 0.7rem; cursor: pointer; }
#chat-form button:disabled { opacity: 0.4; cursor: not-allowed; }
#btn-mic.recording { background: var(--danger); color: #fff; }
#input-texto {
  flex: 1; resize: none; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem;
  max-height: 8rem;
}
#btn-enviar { background: var(--accent); color: #221a03; font-weight: 700; }
.status { text-align: center; color: var(--muted); font-size: 0.78rem; margin: 0 0 0.5rem; min-height: 1em; }
