:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --gold: #f59e0b;
  --ok: #16a34a;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  min-height: 100dvh;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: var(--shadow);
}
.brand-row h1 { font-size: 19px; margin: 0; font-weight: 800; letter-spacing: -0.3px; }
.brand-row p { margin: 0; font-size: 12.5px; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; margin: 0 0 14px; font-weight: 700; }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; color: #334155; }
label:first-of-type { margin-top: 0; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 4px; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
textarea { resize: vertical; min-height: 92px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .08s, background .15s, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-ghost { background: #eef2ff; color: var(--brand-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn + .btn { margin-top: 10px; }

.stars { display: flex; gap: 6px; justify-content: center; margin: 4px 0 2px; }
.stars button {
  background: none; border: none; padding: 2px; cursor: pointer;
  font-size: 34px; line-height: 1; color: #d6dae2; transition: transform .1s;
}
.stars button.on { color: var(--gold); }
.stars button:active { transform: scale(1.2); }

.review-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  font-size: 16.5px;
  line-height: 1.55;
  min-height: 96px;
  width: 100%;
  color: var(--ink);
}
.review-box:focus { outline: none; border-color: var(--brand); background:#fff; }

.steps { list-style: none; padding: 0; margin: 14px 0 0; }
.steps li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 14px; color: #334155; padding: 7px 0;
}
.steps .n {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: #eef2ff; color: var(--brand-dark);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}

.qr-card { text-align: center; }
.qr-card img { width: 230px; height: 230px; border-radius: 14px; border: 1px solid var(--line); background:#fff; }
.linkbox {
  display: flex; gap: 8px; margin-top: 12px;
}
.linkbox input { font-size: 13px; color: var(--muted); }

.note {
  font-size: 12.5px; color: var(--muted);
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
}
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.center { text-align: center; }
.muted { color: var(--muted); font-size: 13px; }
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.45);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-ghost .spinner { border-color: rgba(67,56,202,.35); border-top-color: var(--brand-dark); }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.tag { display:inline-block; font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; }
.tag-ai { background:#ecfdf5; color:#047857; }
.tag-local { background:#fef2f2; color:#b91c1c; }

/* ---- Admin ---- */
.brand-row { position: relative; }
.pill { font-size: 11px; font-weight: 800; background: var(--brand); color:#fff; padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.linkbtn { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.err { background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; border-radius:12px; padding:10px 12px; font-size:13px; }
.btn-danger { background:#fef2f2; color:#b91c1c; }
.btn-danger:active { background:#fee2e2; }

.sep { display:flex; align-items:center; gap:10px; margin:18px 0 4px; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.05em; }
.sep::before, .sep::after { content:''; height:1px; background:var(--line); flex:1; }

/* ---- Tarjetas de proyecto ---- */
.proj { border:1px solid var(--line); border-radius:14px; padding:14px; margin-top:12px; background:#fcfcfd; }
.proj-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.proj-name { font-weight:800; font-size:16px; }
.proj-type { font-size:12.5px; color:var(--muted); }
.proj-qr { width:64px; height:64px; border-radius:8px; border:1px solid var(--line); background:#fff; flex:none; }
.proj-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.proj-actions .btn { flex:1 1 calc(50% - 4px); min-width:70px; padding:10px; font-size:14px; margin-top:0; }

/* Estado pausado */
.proj.is-off { opacity:.62; }
.proj.is-off .proj-qr { filter:grayscale(1); }
.badge-off { font-size:11px; font-weight:800; background:#fef2f2; color:#b91c1c; padding:2px 8px; border-radius:999px; margin-left:8px; vertical-align:middle; }

/* Interruptor activar/pausar */
.proj-toggle { display:flex; align-items:center; gap:10px; margin-top:12px; flex-wrap:wrap; }
.switch { position:relative; display:inline-block; width:46px; height:26px; flex:none; }
.switch input { opacity:0; width:0; height:0; }
.slider { position:absolute; inset:0; background:#cbd5e1; border-radius:999px; transition:.2s; cursor:pointer; }
.slider::before { content:''; position:absolute; height:20px; width:20px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background:var(--ok); }
.switch input:checked + .slider::before { transform:translateX(20px); }
.switch input:disabled + .slider { opacity:.6; }
.toggle-label { font-size:13.5px; font-weight:700; color:#334155; }
.toggle-hint { font-size:11.5px; color:var(--muted); }

/* ---- Página pública ---- */
.stars-static { text-align:center; color:var(--gold); font-size:30px; letter-spacing:4px; margin:2px 0 12px; }
