:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --ink: #12131a;
  --muted: #6b6f80;
  --line: #e4e6ee;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --ok: #0f9d6b;
  --warn: #c27c0e;
  --bad: #d23c3c;
  --side: #0f1020;
  --side-ink: #c9cbe0;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Manrope, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 24px; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { color: #fff; font-weight: 800; font-size: 18px; padding: 4px 10px 18px; letter-spacing: -0.02em; }
.brand span { color: #8b85ff; }
.nav-link { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 10px; font-weight: 600; }
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link.on { background: rgba(139, 133, 255, 0.18); color: #fff; }
.nav-link .soon { font-size: 11px; background: rgba(255, 255, 255, 0.1); padding: 2px 7px; border-radius: 99px; font-weight: 600; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #6d7090; padding: 16px 12px 6px; }
.side-foot { margin-top: auto; font-size: 13px; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.side-foot button { background: none; border: 0; color: #8b85ff; padding: 0; cursor: pointer; font-weight: 600; }

.main { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sub { color: var(--muted); margin-top: 4px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-proj { grid-template-columns: 340px 1fr; align-items: start; }

.btn { border: 1px solid var(--line); background: var(--panel); padding: 9px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: #c9ccda; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--bg); color: var(--bad); }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 44px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 110px; }
.row > .field.color { flex: 0 0 auto; min-width: 0; }
.row > .field.color label { font-size: 11px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #fafbff; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.listo { background: #e3f7ef; color: var(--ok); }
.badge.esperando_aprobacion { background: #fff4df; color: var(--warn); }
.badge.error { background: #fde8e8; color: var(--bad); }
.badge.work { background: var(--accent-soft); color: var(--accent); }
.badge.work::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; background: var(--accent); transition: width 0.4s; }

.phone { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 18px; overflow: hidden; position: relative; }
.phone video { width: 100%; height: 100%; object-fit: contain; display: block; }
.phone .empty { position: absolute; inset: 0; display: grid; place-items: center; color: #8d90a6; text-align: center; padding: 24px; font-size: 14px; }

.versions { margin-top: 14px; display: grid; gap: 8px; }
.version { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; cursor: pointer; }
.version.on { border-color: var(--accent); background: var(--accent-soft); }
.version b { font-size: 14px; }

.list { display: grid; gap: 6px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border-radius: 10px; font-size: 13px; }
.item .t { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.item .m { color: var(--muted); flex: 1; }

.chat { display: grid; gap: 10px; max-height: 360px; overflow: auto; padding-right: 4px; margin-bottom: 12px; }
.msg { padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.msg .txt { white-space: pre-wrap; }
.msg .who { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.msg.claude { background: var(--accent-soft); }
.msg.claude .who { color: var(--accent); }
.msg.sistema { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.scenes td { font-size: 13px; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; background: #fbfbfe; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { display: block; font-size: 16px; margin-bottom: 4px; }

.preview-box { width: 220px; aspect-ratio: 9 / 16; border-radius: 16px; position: relative; overflow: hidden; background: linear-gradient(160deg, #5a6170, #262a33); flex-shrink: 0; }
.preview-box .face { position: absolute; top: 26%; width: 40%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.18); transform: translateX(-50%); }
.preview-box .cap { position: absolute; left: 8%; right: 8%; text-align: center; line-height: 1.1; }
.preview-box .hook { position: absolute; top: 12%; left: 10%; right: 10%; text-align: center; padding: 4px 6px; }

.login { min-height: 100vh; display: grid; place-items: center; background: var(--side); }
.login .card { width: min(380px, 92vw); }
.login h1 { margin-bottom: 4px; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state b { color: var(--ink); display: block; font-size: 17px; margin-bottom: 6px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.toast.bad { background: var(--bad); }

.thumbs { display: flex; gap: 6px; margin-top: 10px; }
.thumbs img { width: 33%; border-radius: 8px; display: block; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .brand { padding: 6px 10px; width: 100%; }
  .nav-sep, .side-foot { display: none; }
  .main { padding: 18px 16px 50px; }
  .cols-2, .cols-proj { grid-template-columns: 1fr; }
}
