/* App de Dili. Mismo lenguaje que la landing: fondo casi negro con resplandor azul y ondas difuminadas,
   tarjetas con bordes finos, botones claros redondeados, Geist para todo y Geist Mono para etiquetas y folios. */
:root {
  --bg: #08090B;
  --paper: #08090B;
  --panel: #0B0D11;
  --card: #0E1013;
  --surface: #0E1013;
  --surface-2: #111317;
  --field: #08090B;
  --line: #1A1D22;
  --line-2: #1C1F25;
  --line-3: #23272E;
  --line-4: #2A2E35;
  --rule: #1C1F25;
  --rule-2: #1A1D22;
  --rule-strong: #2A2E35;
  --ink: #EDEEF0;
  --ink-2: #C9CCD1;
  --ink-3: #A3A8B1;
  --muted: #8A8F98;
  --muted-2: #6B717B;
  --blue: #5B8CFF;
  --blue-soft: rgba(91, 140, 255, 0.14);
  --navy: #5B8CFF;
  --navy-soft: rgba(91, 140, 255, 0.1);
  --teal: #00C9B7;
  --green: #3DD68C;
  --green-soft: rgba(61, 214, 140, 0.1);
  --yellow: #F5B942;
  --yellow-bar: #F5B942;
  --yellow-soft: rgba(245, 185, 66, 0.1);
  --red: #FF6B6B;
  --red-soft: rgba(255, 107, 107, 0.1);
  --gray-soft: rgba(255, 255, 255, 0.05);
  --font-display: Geist, system-ui, sans-serif;
  --font-body: Geist, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: #FFFFFF; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::placeholder { color: #5C616B; }
::selection { background: rgba(91, 140, 255, 0.3); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 8px; }
h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.015em; margin-bottom: 14px; }
h3 { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 8px; }
p { margin-bottom: 10px; }
code, .mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Fondo animado (lo dibuja /js/waves.js) */
#waves { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: radial-gradient(70% 60% at 60% -10%, #0B1A3A 0%, #08090B 70%); }
@keyframes dili-wave { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .dili-wave { animation: none !important; } }

/* Encabezado */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(8, 9, 11, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; gap: 28px; }
.logo { display: block; line-height: 0; flex: none; }
.logo img { height: 28px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-size: 14px; color: var(--muted); padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.nav a.active { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.topbar-end { display: flex; align-items: center; gap: 8px; flex: none; }
.org-select { width: auto; max-width: 220px; padding: 7px 10px; font-size: 13px; }

/* Barra de saldo */
.statusbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; margin-top: 28px;
  background: rgba(11, 13, 17, 0.75); border: 1px solid var(--line-2); border-radius: 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted-2); text-transform: uppercase;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); flex: none; }
.status-dot.live { background: var(--green); box-shadow: 0 0 12px var(--green); }
.status-balance { color: var(--ink); font-weight: 500; }
.status-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-4), transparent); min-width: 40px; }
.status-org, .status-user { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.status-clock { white-space: nowrap; font-variant-numeric: tabular-nums; }
.status-clock span { color: var(--ink-2); }

/* Layout */
.shell { max-width: 1200px; margin: 0 auto; padding: 0 32px 96px; }
.main { padding-top: 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }

/* Tarjetas */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.card + .card { margin-top: 12px; }
.grid > .card, .grid > .card + .card { margin-top: 0; }
.card > h2:first-child { padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
button.card { display: block; font: inherit; color: inherit; width: 100%; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* KPIs: celdas unidas por líneas de 1px, como el semáforo de la landing */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpis .stat { background: #0B0C0F; padding: 22px 24px; }
.stat .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); display: flex; align-items: center; gap: 8px; }
.stat.lead .label { color: var(--blue); }
.stat.lead .label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.stat .value { font-size: 44px; font-weight: 600; letter-spacing: -0.045em; line-height: 1; margin: 14px 0 8px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--muted); font-size: 13.5px; }

/* Formularios */
label { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12.5px; color: var(--muted-2); margin-top: 6px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-3); border-radius: 9px;
  font: inherit; font-size: 15px; color: var(--ink); background: var(--field);
}
select option { background: #111317; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
input:disabled, select:disabled { opacity: 0.5; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
input[type="color"] { padding: 4px; height: 42px; }
textarea { resize: vertical; }
.checkbox { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--ink-2); margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-4);
  background: transparent; color: var(--ink-2); font: inherit; font-size: 14.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { border-color: #4A505A; color: #FFFFFF; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line-4); color: var(--ink-2); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #FFFFFF; border-color: #FFFFFF; color: var(--bg); }
.btn-primary:disabled:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: var(--line-4); }
.btn-danger { color: var(--red); border-color: rgba(255, 107, 107, 0.35); }
.btn-danger:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-link { border: none; background: none; color: var(--blue); padding: 0; font: inherit; font-weight: 500; cursor: pointer; }
.btn-link:hover { color: #8DB0FF; }

/* Tablas */
.table-wrap { overflow-x: auto; color-scheme: dark; scrollbar-color: var(--line-4) transparent; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); }
td.mono, .mono { color: var(--ink-3); }
td.mono { white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(255, 255, 255, 0.025); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.green::before { box-shadow: 0 0 8px var(--green); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--gray-soft); color: var(--ink-3); }
.badge.brand { background: var(--blue-soft); color: var(--blue); }
.badge.plain { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; border-radius: 6px; }
.badge.plain::before { display: none; }

/* Semáforo de la Dili */
.semaphore-hero {
  border-radius: var(--radius); padding: 26px 28px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line-2); position: relative; overflow: hidden;
}
.semaphore-hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--c, var(--blue)), transparent); }
.semaphore-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--blue)) 9%, transparent), transparent 70%); }
.semaphore-hero > * { position: relative; z-index: 1; }
.semaphore-hero .big { font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -0.045em; margin-bottom: 10px; color: var(--c, var(--ink)); }
.semaphore-hero.green { --c: var(--green); }
.semaphore-hero.yellow { --c: var(--yellow); }
.semaphore-hero.red { --c: var(--red); }
.semaphore-hero.pending { --c: var(--blue); }
.semaphore-hero.pending .big { color: var(--ink); }

/* Hallazgos */
.finding { display: block; padding: 16px 18px 16px 20px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; position: relative; }
.finding::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--muted-2); }
.finding.red::before { background: var(--red); }
.finding.yellow::before { background: var(--yellow); }
.finding.green::before { background: var(--green); }
.finding .title { font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; }
.finding .detail { color: var(--muted); margin-top: 6px; }
.finding .rec { margin-top: 6px; color: var(--ink-2); }
.finding .evidence { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted-2); display: flex; gap: 10px; flex-wrap: wrap; }

/* Gráfica de resultados */
.bars { display: grid; gap: 16px; }
.bar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 40px; gap: 14px; align-items: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.bar-row .track { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 3px; }
.bar-row .num { font-family: var(--font-body); font-size: 20px; font-weight: 600; letter-spacing: -0.03em; text-align: right; color: var(--ink); text-transform: none; font-variant-numeric: tabular-nums; }
.chart-note { font-size: 13px; color: var(--muted-2); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Carga de archivos */
.dropzone { border: 1px dashed var(--line-4); border-radius: var(--radius); padding: 28px; text-align: center; background: var(--panel); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover { border-color: #4A505A; }
.dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--line); }

/* Pestañas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--blue); }

/* Acceso */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px 30px 28px; background: linear-gradient(180deg, #0F1115, #0B0C0F); border-radius: 16px; }
.auth-card .logo { margin-bottom: 32px; }
.auth-card .logo img { height: 28px; }
.auth-card h1 { font-size: 30px; }
.auth-card > p.muted { margin-bottom: 22px; }

/* Avisos */
.alert-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: none; }
.alert-item .alert-title { font-size: 15px; font-weight: 500; }

/* Mensajes */
.callout { border-radius: 12px; padding: 13px 16px; background: var(--blue-soft); border: 1px solid rgba(91, 140, 255, 0.3); color: var(--ink-2); }
.callout.warn { background: var(--yellow-soft); border-color: rgba(245, 185, 66, 0.3); }
.callout a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--field); border: 1px solid var(--line-3); border-radius: 9px; padding: 10px 12px; word-break: break-all; }
pre { background: var(--field) !important; border: 1px solid var(--line-3) !important; border-radius: 10px !important; color: var(--ink-3); }

/* Estado vacío: dashboard de ejemplo atenuado con la invitación encima */
.sample { position: relative; }
.sample-content { opacity: 0.3; filter: saturate(0.5); pointer-events: none; user-select: none; }
.sample-tag { position: absolute; top: -26px; right: 0; z-index: 2; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--muted-2); display: inline-flex; align-items: center; gap: 8px; }
.sample-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.sample-cta {
  position: absolute; z-index: 3; left: 50%; top: 150px; transform: translateX(-50%); width: min(520px, calc(100% - 24px));
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.12), #0B0D11 70%), #0B0D11; border: 1px solid var(--line-3); border-radius: 20px;
  padding: 30px; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9);
}
.sample-cta h2 { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.08; margin-bottom: 12px; padding: 0; border: none; }
.sample-cta p { color: var(--muted); font-size: 15.5px; }
.sample-cta .row { margin-top: 22px; }

/* Toasts */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: #111317; color: var(--ink); border: 1px solid var(--line-3); padding: 12px 16px; border-radius: 10px; font-size: 14px; max-width: 380px; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8); }
.toast.error { color: var(--red); border-color: rgba(255, 107, 107, 0.4); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 5, 7, 0.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px 16px; z-index: 40; }
.modal { background: #0E1013; border: 1px solid var(--line-3); border-radius: 16px; max-width: 560px; width: 100%; padding: 26px; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* Páginas públicas */
.public-wrap { max-width: 780px; margin: 0 auto; padding: 64px 16px 72px; }
.public-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.public-head img { max-height: 48px; max-width: 180px; background: #FFFFFF; padding: 6px; border-radius: 8px; }
.public-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 13px; }
.public-foot img { height: 20px; width: auto; }

.empty { text-align: center; padding: 36px 10px; color: var(--muted-2); font-size: 14px; }
.spinner { width: 16px; height: 16px; border: 1.5px solid var(--line-4); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .topbar-inner { padding: 0 16px; gap: 12px; height: auto; min-height: 64px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 8px; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -8px; }
  .topbar-end { margin-left: auto; }
  .shell { padding: 0 16px 64px; }
  .status-user, .status-org { display: none; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 32px; }
  .stat .value { font-size: 36px; }
  .semaphore-hero { flex-direction: column; align-items: flex-start; }
  .sample-cta { top: 110px; padding: 24px 22px; }
  .sample-cta h2 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .dropzone { transition: none; }
  .spinner { animation-duration: 2s; }
}

/* Paquetes de Dilis */
.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.package { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 18px; transition: border-color .15s ease; }
.package:hover { border-color: var(--line-4); }
.package-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.package-count { font-size: 15px; font-weight: 500; }
.package-saving { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; color: var(--green); }
.package-price { font-size: 34px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.package-price span { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted-2); }
.package-units { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); border-radius: 10px; overflow: hidden; margin-top: auto; }
.package-units div { background: var(--panel); padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; }
.package-units span { font-size: 12px; color: var(--muted-2); }
.package-units strong { font-size: 15px; font-weight: 500; }

/* Errores de validación por campo */
.field-error { color: var(--red); font-size: 12.5px; margin-top: 6px; }
.invalid, .invalid:focus { border-color: var(--red) !important; }

/* Lista de documentos esperados dentro de cada zona de carga */
.upload { margin-top: 8px; }
.doc-checklist { list-style: none; margin: 18px auto 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px 24px; text-align: left; max-width: 760px; }
.doc-checklist li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; color: var(--ink-2); }
.doc-checklist li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; transform: translateY(-2px); background: var(--blue); }
.doc-checklist li.opt { color: var(--muted); }
.doc-checklist li.opt::before { background: transparent; border: 1px solid var(--muted-2); }
.doc-checklist small { color: var(--muted-2); font-size: 12px; }
.dropzone.invalid { border-color: var(--red); }

/* Espacios de documentos, borrador, volver a revisar y link del vendedor */
.modal { max-height: calc(100vh - 40px); overflow-y: auto; }
.modal:has(.operation-edit) { max-width: 720px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; }
.badge.small { font-size: 10.5px; padding: 2px 8px; }
.type-choice { text-align: left; cursor: pointer; font: inherit; color: inherit; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--card); transition: border-color .15s ease, background .15s ease; }
.type-choice:hover { border-color: var(--line-4); }
.type-choice.active { border-color: var(--blue); background: var(--blue-soft); }
.type-choice-title { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 4px; }
.section-sub { margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; }
.submit-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding: 18px 22px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); }
.submit-bar > .small { max-width: 520px; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.slot { border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); padding: 14px 16px; min-width: 0; transition: border-color .15s ease, background .15s ease; }
.slot.drag { border-color: var(--blue); background: var(--blue-soft); }
.slot.filled, .slot.received { border-color: rgba(61, 214, 140, 0.28); }
.slot.missing, .slot.needed { border-color: rgba(245, 185, 66, 0.3); }
.slot.rejected { border-color: rgba(255, 107, 107, 0.4); }
.slot.optional { opacity: 0.85; }
.slot-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.slot-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 14.5px; }
.slot-meta { grid-column: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 15px; }
.slot-title strong { font-weight: 500; }
.slot-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--blue); transform: translateY(-1px); }
.slot-dot.opt { background: transparent; border: 1px solid var(--muted-2); }
.slot-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.file-list.compact li { padding: 7px 0; font-size: 13.5px; }
.file-list.compact li:last-child { border-bottom: none; }
.doc-list { list-style: none; margin: 10px 0 0; padding: 0; }
.doc-row { display: flex; gap: 8px 12px; align-items: flex-start; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.doc-row > .grow { flex: 1 1 220px; }
.card > .slots { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.doc-row.removed { opacity: 0.5; }
.doc-row.rejected .doc-name { text-decoration: line-through; text-decoration-color: var(--red); }
.doc-name { font-size: 14px; color: var(--ink-2); max-width: 100%; }
.doc-actions { flex: none; gap: 6px; }
.doc-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.doc-note.warn { color: var(--yellow); }

.semaphore-hero.draft { --c: var(--blue); }
.hero-actions { flex: none; }
.rerun-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); }
.rerun-bar.has-new { border-color: rgba(91, 140, 255, 0.45); background: linear-gradient(90deg, var(--blue-soft), var(--card) 70%); }
.rerun-bar .small { margin-top: 4px; max-width: 620px; }
.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px 24px; margin: 0; }
.data-grid dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 4px; }
.data-grid dd { margin: 0; color: var(--ink-2); font-size: 14.5px; word-break: break-word; }

.notice { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-3); background: var(--panel); color: var(--ink-2); margin: 16px 0; }
.upload-summary { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; margin: 18px 0 16px; border-radius: 12px; border: 1px solid rgba(245, 185, 66, 0.3); background: var(--yellow-soft); }
.upload-summary.done { border-color: rgba(61, 214, 140, 0.3); background: var(--green-soft); }
.public-wrap .card { margin-bottom: 16px; }

@media (max-width: 640px) {
  .slot-head { grid-template-columns: 1fr; }
  .slot-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 8px; }
  .slot-meta { padding-left: 0; }
  .doc-row { flex-wrap: wrap; }
  .doc-name { max-width: 100%; }
  .submit-bar .row { width: 100%; }
  .submit-bar .btn { flex: 1; }
}

/* Caja de "sube todo": Dili clasifica cada archivo y lo acomoda en su espacio */
.dump-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 34px 22px; border: 1.5px dashed var(--line-4); border-radius: var(--radius); background: linear-gradient(180deg, var(--blue-soft), transparent 80%), var(--panel); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.dump-zone:hover, .dump-zone:focus-visible { border-color: var(--blue); outline: none; }
.dump-zone.drag { border-color: var(--blue); background: var(--blue-soft); transform: scale(1.005); }
.dump-zone strong { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.dump-zone .small { max-width: 520px; }
.dump-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; line-height: 1; color: var(--blue); border: 1px solid rgba(91, 140, 255, 0.45); margin-bottom: 4px; }
.sorting { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border: 1px solid rgba(91, 140, 255, 0.35); border-radius: 12px; background: var(--blue-soft); }
.small-spinner { width: 18px; height: 18px; flex: none; }
.one-by-one { margin-top: 16px; }
.one-by-one > summary { cursor: pointer; color: var(--ink-3); font-size: 14px; padding: 8px 0; }
.one-by-one > summary:hover { color: var(--ink); }
.one-by-one[open] > summary { margin-bottom: 10px; }
.move-select { width: auto; max-width: 170px; padding: 6px 10px; font-size: 13px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .dump-zone { transition: none; } .dump-zone.drag { transform: none; } }
@media (max-width: 640px) {
  .doc-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .doc-actions .move-select { flex: 1 1 140px; max-width: none; }
}

/* Detalle con pestañas */
.tabs { display: flex; gap: 4px; margin: 4px 0 12px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border: none; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); border-bottom-color: var(--blue); }
.tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-family: var(--font-mono); background: var(--gray-soft); color: var(--ink-3); }
.tab-count.alert { background: var(--yellow-soft); color: var(--yellow); }
.report-meta { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.optional-slots { margin-top: 14px; }
.optional-slots > summary { cursor: pointer; font-size: 14px; color: var(--ink-3); padding: 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.optional-slots > summary:hover { color: var(--ink); }
.optional-slots[open] > summary { margin-bottom: 10px; white-space: normal; }

.data-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; margin-top: 12px; }
.data-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.data-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.data-card-head strong { font-weight: 500; font-size: 15px; }
.data-list { margin: 0; }
.data-list > div { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.data-list > div:first-child { border-top: none; }
.data-list dt { color: var(--muted-2); }
.data-list dd { margin: 0; color: var(--ink-2); word-break: break-word; }
.data-list > div.missing dd { color: var(--muted-2); }

.link-list { display: flex; flex-direction: column; }
.link-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.link-row:first-child { border-top: none; }
.link-row.inactive { opacity: 0.55; }
.link-url { margin: 6px 0 4px; word-break: break-all; color: var(--ink-3); }
.link-actions { flex: none; gap: 6px; }
@media (max-width: 640px) { .link-actions { flex: 1 1 100%; } }
