/* PUIG Video AI — piel moderna (tokens turquesa del brief) sobre la app existente.
   Mismos selectores que las plantillas: solo cambia la estetica, no la funcionalidad. */
:root {
  --brand: #0e9aae;
  --brand-dark: #0b7d8e;
  --brand-deep: #0b505d;
  --brand-50: #e7f7f9;
  --brand-100: #c9edf1;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #eceef1;
  --line-strong: #dde2e8;
  --ink: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --err: #b45309;
  --err-bg: #fef3c7;
  --info: #0b7d8e;
  --info-bg: #e7f7f9;
  --violet: #6366f1;
  --gold: #b45309;
  --radius: 16px;
  --r-btn: 11px;
  --shadow: 0 1px 2px rgba(16,24,40,.04);
  --shadow-hover: 0 12px 26px -14px rgba(15,23,42,.28);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; font-size: 14.5px;
  background: var(--bg); color: var(--ink); }
a { color: inherit; }
button { font-family: inherit; }

/* ================= shell: sidebar + main ================= */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.main { display: flex; flex-direction: column; min-width: 0; }
.main > main { padding: 26px 30px 80px; max-width: 1280px; width: 100%; }
main.anon { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 20px; }

.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex;
  flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sb-logo { display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px; }
.sb-logo img { height: 14px; display: block; }
.sb-logo .divider { width: 1px; height: 18px; background: var(--line-strong); }
.sb-logo .app-name { font-size: 12.5px; font-weight: 600; color: var(--faint); }
.sb-section { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--faint);
  padding: 16px 22px 6px; }
.sb-nav { padding: 0 12px; }
.sb-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-bottom: 2px;
  border-radius: 11px; text-decoration: none; font-size: 14px; font-weight: 600; color: #334155; }
.sb-nav a svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.sb-nav a:hover { background: #f8fafc; }
.sb-nav a:hover svg { color: var(--brand); }
.sb-foot { margin-top: auto; padding: 14px 16px 16px; }
.sb-balance { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff;
  border-radius: 14px; padding: 13px 15px; }
.sb-balance .lbl { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; opacity: .9; }
.sb-balance .num { font-size: 21px; font-weight: 800; margin-top: 2px; }
.sb-balance .num small { font-size: 11.5px; font-weight: 700; opacity: .85; }
.sb-credit { text-align: center; font-size: 11px; color: var(--faint); margin-top: 12px; }
.sb-credit a { font-weight: 700; text-decoration: none; }

.topbar { background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 30px;
  display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20; }
.tb-spacer { margin-right: auto; }
.lang-switch { display: flex; background: #f1f5f9; border-radius: 10px; padding: 3px; }
.lang-switch a { text-decoration: none; font-size: 12px; font-weight: 800; padding: 5px 12px;
  border-radius: 8px; color: var(--faint); }
.lang-switch a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.credit-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-50);
  border: 1px solid var(--brand-100); color: var(--brand-dark); border-radius: 999px;
  padding: 7px 15px; font-size: 13px; font-weight: 600; }
.credit-chip b { font-weight: 800; color: var(--ink); }
.role-badge { padding: 5px 13px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.role-puig { background: #0f172a; color: #fff; }
.role-marca { background: var(--brand-50); color: var(--brand-dark); border: 1px solid var(--brand-100); }
.role-fotoempresas { background: #eef2ff; color: var(--violet); border: 1px solid #e0e7ff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; }
.logout { color: var(--faint); text-decoration: none; font-size: 12.5px; font-weight: 700; }
.logout:hover { color: var(--ink); }
.nav-count { background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 8px;
  font-size: 11px; font-weight: 800; margin-left: 4px; }

/* ================= tipografia ================= */
h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 6px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; max-width: 720px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.back-link:hover { color: var(--ink); }
h2 { font-size: 12px; font-weight: 800; color: var(--faint); text-transform: uppercase;
  letter-spacing: .1em; margin: 30px 0 12px; }
h3 { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; margin: 14px 0 9px; }
.sub { color: var(--muted); font-size: 12.5px; }

/* ================= superficies ================= */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px;
  vertical-align: middle; }
th { font-weight: 800; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; }
tr:last-child td { border-bottom: 0; }
table tr:hover td { background: #fafbfc; }

/* ================= estados ================= */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11px;
  font-weight: 700; white-space: nowrap; }
.b-ok, .b-ready, .b-done, .b-analizado, .b-retouched, .b-final { background: var(--ok-bg); color: #0b7a48; }
.b-needs_retouch, .b-ko_regen, .b-ko_manual, .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-failed, .b-error_analisis { background: var(--err-bg); color: var(--err); }
.b-generating, .b-queued, .b-analizando, .b-review, .b-nuevo, .b-retouching { background: var(--info-bg); color: var(--info); }

.flash { padding: 11px 16px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; }
.flash-ok { background: var(--ok-bg); color: #0b7a48; }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-error { background: var(--err-bg); color: var(--err); }

/* ================= botones e inputs ================= */
button, .btn {
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: var(--r-btn); padding: 9px 17px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 6px 14px -6px rgba(14,154,174,.45);
  transition: background .12s ease;
}
button:hover, .btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.btn-ghost:hover { background: #f8fafc; border-color: var(--line-strong); }
.btn-ok { background: var(--ok); border-color: var(--ok); box-shadow: 0 6px 14px -6px rgba(21,128,61,.45); }
.btn-ok:hover { background: #116631; border-color: #116631; }
.btn-warn { background: #f59e0b; border-color: #f59e0b; box-shadow: 0 6px 14px -6px rgba(245,158,11,.45); }
.btn-warn:hover { background: #d9890a; border-color: #d9890a; }
.btn-err { background: var(--err); border-color: var(--err); box-shadow: 0 6px 14px -6px rgba(180,83,9,.4); }
.btn-err:hover { background: #92400e; border-color: #92400e; }
/* enviar a edicion manual: accion neutra (aprueba y deriva), no destructiva */
.btn-edit { background: #1d4ed8; border-color: #1d4ed8; box-shadow: 0 6px 14px -6px rgba(29,78,216,.45); }
.btn-edit:hover { background: #1e40af; border-color: #1e40af; }
.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-lg { padding: 12px 26px; font-size: 14.5px; }

input[type=text], input[type=number], input[type=password], input[type=email], select, textarea {
  font-family: inherit; font-size: 13.5px; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-btn); background: #fbfcfd; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px;
  border-color: var(--brand); background: #fff; }
textarea { font-family: Consolas, monospace; font-size: 12.5px; }
label { display: block; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase;
  letter-spacing: .08em; margin: 14px 0 6px; }
.check label { display: inline; font-weight: 500; text-transform: none; letter-spacing: 0;
  font-size: 13.5px; color: var(--ink); }
input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; }
form.inline { display: inline; }
.field-error { border-color: var(--err) !important; background: var(--err-bg) !important; }
.ko-hint { color: var(--err); font-size: 12px; margin-top: 5px; }
.res-select { width: auto !important; padding: 7px 8px !important; font-size: 12px !important; }
.gen-form { display: inline-flex; gap: 7px; align-items: center; }
.elements-check { display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 700;
  color: var(--muted); cursor: help; margin: 0; }

/* ================= fotografia ================= */
.thumb { width: 110px; height: 146px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #eef1f5; }
.thumb-sm { width: 66px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
video { width: 100%; max-width: 340px; border-radius: 12px; background: #0b1220; }
.pair-card { display: flex; gap: 18px; align-items: flex-start; }
.arrow { font-size: 18px; color: var(--faint); }
[data-full] { cursor: zoom-in; transition: filter .15s ease; }
[data-full]:hover { filter: brightness(1.05); }

/* ================= lista de articulos ================= */
details.article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 10px; }
details.article > summary { display: flex; align-items: center; gap: 14px; padding: 15px 20px;
  cursor: pointer; list-style: none; }
details.article > summary::-webkit-details-marker { display: none; }
details.article > summary .chev { color: var(--faint); font-size: 12px; transition: transform .15s; }
details.article[open] > summary .chev { transform: rotate(90deg); }
details.article > summary .art-code { font-weight: 800; font-size: 14px; }
.art-badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.art-body { padding: 6px 20px 20px; border-top: 1px solid var(--line); }

.views-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.viewcard { text-align: center; }
.viewcard img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line); background: #eef1f5; display: block; }
.vc-caption { margin-top: 8px; font-size: 12px; line-height: 1.55; }
.vc-title { font-weight: 700; font-size: 12px; }
.vc-reason { color: var(--warn); font-size: 11.5px; margin-top: 4px; }
.bg-swatch { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--line-strong);
  border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.bg-deviates { color: var(--warn); font-weight: 700; }
.viewcard.vc-sm { width: 118px; }

.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.clip-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  background: var(--panel); box-shadow: var(--shadow); }
.clip-card:hover { box-shadow: var(--shadow-hover); }
.clip-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.clip-head b { font-size: 13.5px; }
.clip-reason { margin: 2px 0 8px; font-size: 11.5px; }
.clip-frames { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 8px; }
.clip-frames .viewcard { width: 46%; }
.rush-block { border-top: 1px solid var(--line); padding: 10px 0 2px; margin-top: 10px; }
.rush-video { width: 100%; max-width: none; border-radius: 12px; background: #0b1220; display: block; }
details.versions { margin-top: 6px; }
details.versions summary { font-size: 11px; color: var(--faint); font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; cursor: pointer; }

/* ================= revision ================= */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 950px) { .review-layout { grid-template-columns: 1fr; } }
.review-head { margin-bottom: 14px; }
.review-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
  text-transform: none; margin: 0; }
.review-media { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.review-media video { width: min(430px, 100%); max-width: none; }
.review-frames { display: flex; gap: 12px; align-items: center; }
.review-frames .viewcard { width: 130px; }
.review-frames .arrow { color: var(--faint); }
.review-actions { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.review-actions input[type=text] { max-width: 560px; }
.review-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.review-side .queue-row { display: block; padding: 10px 12px; border-radius: 11px; text-decoration: none;
  font-size: 12.5px; border: 1px solid transparent; margin-bottom: 4px; }
.review-side .queue-row:hover { background: var(--bg); }
.review-side .queue-row.active { border-color: var(--brand-100); background: var(--brand-50); }
.review-side .queue-row .sub { margin-left: 6px; }

/* ================= herramientas por vista (flag manual / instruccion) ================= */
.vc-tools { margin-top: 6px; font-size: 12px; }
.vc-tools summary { cursor: pointer; color: var(--brand-dark); font-weight: 700; font-size: 12px; }
.vc-tools form { margin-top: 6px; }
.vc-tools textarea, .vc-tools select, .vc-tools input[type=file] { width: 100%; font-size: 12px; margin-bottom: 5px; }

/* ================= bandeja de correos: vista HTML ================= */
.email-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 12px;
  background: #f6f7f9; margin-top: 10px; }

/* ================= login (hero a dos columnas — diseño FINAL) ================= */
main.anon { padding: 0; }
.login-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; width: 100%; }
@media (max-width: 900px) { .login-shell { grid-template-columns: 1fr; } .login-hero { display: none; } }
.login-hero { background: linear-gradient(160deg, var(--brand-deep) 0%, var(--brand) 100%); color: #fff;
  padding: 52px 56px; display: flex; flex-direction: column; }
.login-hero .lh-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.login-hero .lh-logo img { height: 16px; filter: invert(1) brightness(2); }
.login-hero .lh-logo .divider { width: 1px; height: 18px; background: rgba(255,255,255,.35); }
.login-hero .lh-logo span { font-size: 13.5px; font-weight: 600; opacity: .9; }
.hero-chip { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: rgba(255,255,255,.14); border-radius: 999px; padding: 8px 16px; font-size: 13px;
  font-weight: 700; margin-bottom: 26px; }
.hero-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #9be8f2; }
.login-hero h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12;
  margin: 0 0 18px; color: #fff; }
.login-hero p { font-size: 15.5px; line-height: 1.65; color: #d2eef3; max-width: 420px; margin: 0; }
.login-hero .lh-foot { margin-top: auto; font-size: 12.5px; color: rgba(255,255,255,.75); }
.login-hero .lh-foot a { color: #fff; font-weight: 700; text-decoration: none; }
.login-form-side { display: flex; align-items: center; justify-content: center; background: #fff; padding: 40px 26px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-wrap .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--brand); margin-bottom: 8px; }
.login-wrap h1 { font-size: 28px; margin: 0 0 4px; }
.login-wrap .login-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.login-wrap .hint { font-size: 12px; color: var(--muted); margin-top: 20px; line-height: 1.8;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.login-wrap .hint .hint-lbl { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: var(--faint); display: block; margin-bottom: 4px; }
.login-wrap button { width: 100%; justify-content: center; padding: 12px; font-size: 14.5px; }
.login-logo { display: none; }

/* ================= revision: reproductor vertical 9:16 + cola de tarjetas ================= */
.review-media { flex-direction: column; }
.review-media video { width: min(340px, 100%); border-radius: 14px; background: #000; }
.review-side .queue-row { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.review-side .queue-row:hover { background: #fafbfc; }
.review-side .queue-row.active { border-color: var(--brand-100); background: var(--brand-50); }
.review-side .queue-row .now { color: var(--brand-dark); font-size: 11.5px; font-weight: 800; }

/* ================= correos / config / creditos ================= */
.email-body { white-space: pre-wrap; font-family: Consolas, monospace; font-size: 12px; background: var(--bg);
  padding: 13px; border-radius: 12px; border: 1px solid var(--line); }
details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 6px 0; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 900px) { .cfg-grid { grid-template-columns: 1fr; } }
.kv { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-on { background: var(--ok); } .dot-off { background: var(--err); }
.stat-big { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.credits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .credits-grid { grid-template-columns: 1fr; } }
.delta-pos { color: #0b7a48; font-weight: 700; }
.delta-neg { color: #b42318; font-weight: 700; }

/* ================= lightbox ================= */
#lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,14,22,.95); display: flex; flex-direction: column; }
#lightbox[hidden] { display: none; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; }
.lb-btn { font-size: 12px; font-weight: 800; background: #1e293b; color: #cbd5e1; border: 0;
  border-radius: 9px; padding: 8px 16px; cursor: pointer; box-shadow: none; }
.lb-btn:hover { background: #334155; }
.lb-btn.active { background: var(--brand); color: #fff; }
.lb-name { color: #94a3b8; font-size: 12px; margin-right: auto; padding-left: 8px; }
.lb-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; }
.lb-body img { max-width: calc(100vw - 40px); max-height: calc(100vh - 84px); object-fit: contain; }
#lightbox.lb-mode-100 .lb-body { display: block; }
#lightbox.lb-mode-100 .lb-body img { max-width: none; max-height: none; margin: 20px auto; display: block; }

/* pareja start/end lado a lado */
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.lb-fig figcaption { color: #cbd5e1; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; }
#lightbox.lb-dual .lb-body { gap: 18px; padding: 0 20px; }
#lightbox.lb-dual .lb-body img { max-width: calc(50vw - 50px); max-height: calc(100vh - 110px); }
#lightbox.lb-dual.lb-mode-100 .lb-body { display: flex; align-items: flex-start; overflow: auto; }
#lightbox.lb-dual.lb-mode-100 .lb-body img { max-width: none; max-height: none; }

/* visor de video con panel de revision */
#vlightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,14,22,.95);
  display: flex; flex-direction: column; }
#vlightbox[hidden] { display: none; }
.vlb-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center;
  gap: 22px; padding: 0 24px 24px; flex-wrap: wrap; }
#vlb-video { max-height: calc(100vh - 90px); max-width: min(62vw, 900px); border-radius: 14px;
  background: #000; }
#vlb-panel { background: var(--panel); border-radius: 14px; padding: 18px 20px;
  width: min(360px, 92vw); box-shadow: var(--shadow-hover); }
#vlb-panel .review-actions { border-top: 0; padding-top: 0; margin-top: 0; }
#vlb-panel input[type=text] { width: 100%; }
.rush-expand { margin-top: 4px; }

/* ================= aviso de novedades ================= */
#refresh-pill { position: fixed; bottom: 26px; right: 26px; z-index: 90; background: var(--brand); color: #fff;
  border: 0; border-radius: 999px; padding: 13px 24px; font-weight: 800; font-size: 13px;
  cursor: pointer; box-shadow: 0 10px 24px -8px rgba(14,154,174,.6); }
#refresh-pill:hover { background: var(--brand-dark); }

/* ================= lote: barra de acciones + lista de referencias + modal ================= */
.batchbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 22px; }
.field { display: flex; flex-direction: column; min-width: 112px; }
.field > label { margin: 0 0 6px; }
.field select, .field input { width: 100%; }
.batchbar .spacer { flex: 1; min-width: 0; }

.reflist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.refrow { display: grid; grid-template-columns: 210px 1fr auto; gap: 18px; align-items: center;
  padding: 15px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s;
  width: 100%; text-align: left; background: none; box-shadow: none; color: inherit; border-radius: 0;
  border-left: 0; border-right: 0; border-top: 0; }
.refrow:last-child { border-bottom: 0; }
.refrow:hover { background: #fafbfc; }
.refrow .code { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.refrow .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.refrow .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ref-open { color: var(--brand-dark); font-weight: 800; font-size: 13px; white-space: nowrap; }
.ref-thumbs { display: flex; }
.ref-thumbs img { width: 34px; height: 44px; object-fit: cover; border-radius: 6px; border: 2px solid #fff;
  margin-left: -8px; box-shadow: 0 1px 3px rgba(0,0,0,.12); background: #eef1f5; }
.ref-thumbs img:first-child { margin-left: 0; }

.am-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding: 30px 18px; overflow-y: auto; }
.am-backdrop[hidden] { display: none; }
.amx { background: var(--bg); width: min(960px, 100%); border-radius: 20px;
  box-shadow: 0 40px 80px -24px rgba(15,23,42,.45); overflow: hidden; margin-bottom: 40px; }
.am-head { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 16px 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; z-index: 3; }
.am-head .code { font-size: 20px; font-weight: 800; }
.am-x { background: #fff; color: var(--muted); border: 1px solid var(--line-strong);
  box-shadow: none; border-radius: 10px; padding: 7px 13px; font-size: 15px; line-height: 1; }
.am-x:hover { background: #f8fafc; }
.am-tabs { display: flex; gap: 4px; padding: 0 22px; background: var(--panel); border-bottom: 1px solid var(--line); }
.am-tab { padding: 12px 16px; font-weight: 800; font-size: 13px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; background: none; box-shadow: none; border-radius: 0; }
.am-tab:hover { background: none; color: var(--ink); }
.am-tab.on { color: var(--brand-dark); border-bottom-color: var(--brand); }
.am-body { padding: 20px 22px; }
.am-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.am-body .clips-grid { grid-template-columns: 1fr; gap: 14px; }
.am-body .clip-card { padding: 16px 18px; }
.am-body .clip-frames { justify-content: flex-start; }
.am-body .clip-frames .viewcard { width: 100px; }
.gen-box { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--brand-50);
  border: 1px solid var(--brand-100); border-radius: 12px; padding: 12px 14px; margin-top: 4px; }
.gen-box .field { min-width: 96px; }
/* dentro de .field los selects van anchos (anulan el .res-select compacto del diseño viejo) */
.field .res-select { width: 100% !important; padding: 10px 12px !important; font-size: 13.5px !important; }
.rowbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.am-body .vc-tools { max-width: none; }
/* selector visual de pareja (miniaturas + invertir) */
.ppicker { margin: 8px 0 4px; }
.pslots { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pslot { border: 2px solid var(--line-strong); border-radius: 10px; padding: 5px; text-align: center;
  cursor: pointer; background: #fff; width: 88px; }
.pslot.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.pslot .plab { font-size: 9px; font-weight: 800; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; display: block; }
.pslot .ps-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; background: #eef1f5;
  display: block; margin: 3px 0; }
.pslot .ps-v { font-size: 11px; font-weight: 800; }
.pinvert { white-space: nowrap; }
.pstrip { display: flex; gap: 6px; flex-wrap: wrap; }
.pthumb { padding: 2px; border: 2px solid transparent; border-radius: 8px; background: none;
  box-shadow: none; cursor: pointer; }
.pthumb:hover { background: #f1f5f9; }
.pthumb img { width: 52px; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; display: block; background: #eef1f5; }
.pthumb span { font-size: 9px; font-weight: 700; color: var(--muted); display: block; text-align: center; margin-top: 2px; }
.pthumb.is-start { border-color: var(--brand); }
.pthumb.is-end { border-color: var(--ok); }
/* rush sin miniatura: linea de datos + boton a pantalla completa; OK/KO se hace en el visor */
.rush-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rush-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.rush-block .review-inline { display: none; }   /* oculto en la tarjeta */
#vlb-panel .review-inline { display: block; }    /* visible al clonarse en el visor */
#vlb-panel .review-inline input[type=text] { width: 100%; margin-bottom: 8px; }

/* ================= accesibilidad ================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3dae2; border-radius: 999px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============ modal de confirmacion propio (sustituye al confirm() nativo) ============ */
#confirm-modal { position: fixed; inset: 0; z-index: 400; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
#confirm-modal[hidden] { display: none; }
.cm-box { background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 24px 60px -12px rgba(15,23,42,.35); max-width: 460px; width: 100%;
  padding: 22px 24px 18px; animation: cm-pop .14s ease-out; }
@keyframes cm-pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.cm-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.cm-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50);
  color: var(--brand-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cm-ico svg { width: 18px; height: 18px; }
.cm-title { font-weight: 800; font-size: 15px; }
.cm-msg { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.cm-actions { display: flex; justify-content: flex-end; gap: 10px; }
