/* =============================================================================
   Vallejo · Web — Sistema de diseño "Aurora" (tema oscuro premium)
   Tipografía Inter/Sora, fondo con aurora, vidrio esmerilado, acentos en
   degradado, sombras suaves y micro-interacciones. Mantiene TODAS las clases
   usadas por las plantillas y el JS.
============================================================================= */

:root {
  /* Neutros */
  --bg:        #070A11;
  --bg-2:      #0A0E17;
  --panel:     rgba(20, 26, 39, 0.72);
  --panel-2:   rgba(28, 35, 52, 0.72);
  --panel-3:   #232c40;
  --linea:     rgba(255, 255, 255, 0.08);
  --linea-2:   rgba(255, 255, 255, 0.14);
  --borde:     rgba(255, 255, 255, 0.08);
  --borde-fuerte: rgba(255, 255, 255, 0.16);

  /* Acentos */
  --acento:    #6E8BFF;
  --acento-2:  #A472FF;
  --acento-3:  #38D6C8;
  --acento-hover: #5C79F5;
  --grad: linear-gradient(135deg, #6E8BFF 0%, #A472FF 55%, #C16BFF 100%);
  --grad-soft: linear-gradient(135deg, rgba(110,139,255,.16), rgba(164,114,255,.10));

  /* Estados */
  --ok:    #34E2A8;
  --aviso: #FFC857;
  --error: #FF7A7A;

  /* Texto */
  --texto: #ECF0FB;
  --suave: #97A3BE;
  --tenue: #61708F;

  /* Formas y sombras */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --sombra:   0 18px 50px -20px rgba(0,0,0,.65), 0 2px 8px rgba(0,0,0,.35);
  --sombra-2: 0 30px 70px -24px rgba(0,0,0,.75);
  --glow: 0 0 0 4px rgba(110,139,255,.16);
  --fuente: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --fuente-display: "Sora", "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
/* Aurora de fondo (fija, no interfiere con el scroll) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1000px 680px at 10% -8%, rgba(110,139,255,.20), transparent 60%),
    radial-gradient(900px 640px at 102% -2%, rgba(164,114,255,.16), transparent 55%),
    radial-gradient(820px 760px at 50% 118%, rgba(56,214,200,.10), transparent 60%),
    var(--bg-2);
}
/* Rejilla sutil sobre la aurora */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(1100px 700px at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(1100px 700px at 50% 0%, #000 0%, transparent 75%);
}

a { color: var(--acento); text-decoration: none; transition: color .15s ease; }
a:hover { color: #9fb2ff; }

::selection { background: rgba(110,139,255,.35); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); background-clip: padding-box; }

/* ---- Barra superior ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 26px;
  padding: 0 26px; height: 66px;
  background: rgba(10, 14, 23, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--linea);
}
.brand {
  font-family: var(--fuente-display);
  font-weight: 800; font-size: 21px; letter-spacing: .3px; color: var(--texto);
  display: inline-flex; align-items: center; gap: 2px;
}
.brand span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px;
  background: var(--grad); box-shadow: 0 0 14px rgba(140,120,255,.8);
}
.brand:hover { text-decoration: none; }
.gear { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; color: var(--suave); font-size: 17px; border: 1px solid var(--linea);
  background: rgba(255,255,255,.04); transition: all .15s ease; margin-left: -8px; }
.gear:hover { color: var(--texto); background: rgba(255,255,255,.1); text-decoration: none; transform: rotate(40deg); }
.nav { display: flex; gap: 6px; }
.nav a {
  color: var(--suave); font-weight: 600; font-size: 14.5px;
  padding: 7px 13px; border-radius: 10px; transition: all .15s ease;
}
.nav a:hover { color: var(--texto); background: rgba(255,255,255,.06); text-decoration: none; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.uname { font-weight: 700; letter-spacing: .2px; }
.role-pill { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 20px; letter-spacing: .3px; }
.role-admin { background: rgba(110,139,255,.14); color: #b3c2ff; border: 1px solid rgba(110,139,255,.3); }
.role-emp { background: rgba(52,226,168,.12); color: var(--ok); border: 1px solid rgba(52,226,168,.28); }

/* ---- Contenedor ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 34px 24px 40px; }
.page-title {
  font-family: var(--fuente-display); font-size: 30px; font-weight: 800;
  letter-spacing: -.4px; margin: 0 0 6px; line-height: 1.15;
}
.muted { color: var(--suave); }
.hint { color: var(--tenue); font-size: 13px; margin-top: 14px; line-height: 1.6; }

/* ---- Rejilla y tarjetas ---- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--linea);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--sombra);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  animation: surgir .5s cubic-bezier(.2,.7,.2,1) both;
}
/* Brillo superior sutil en el borde de la tarjeta */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.card h2 {
  font-family: var(--fuente-display); margin: 0 0 16px; font-size: 17.5px; font-weight: 700;
  letter-spacing: -.2px; display: flex; align-items: center; gap: 10px;
}
.card h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--grad);
  box-shadow: 0 0 12px rgba(140,120,255,.55);
}
.cola-cab h2::before, .card h2.sin-barra::before { display: none; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.card.narrow { max-width: 460px; }

@keyframes surgir { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- Formularios ---- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: 12px;
  color: var(--suave); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.form input, .form select, .form textarea,
.composer input, .composer select {
  background: rgba(7, 10, 17, 0.7); color: var(--texto);
  border: 1px solid var(--borde); border-radius: var(--r-sm);
  padding: 12px 14px; font-size: 15px; font-family: inherit; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form input::placeholder, .form textarea::placeholder { color: var(--tenue); }
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--acento); box-shadow: var(--glow); background: rgba(7,10,17,.9);
}
.form textarea { resize: vertical; line-height: 1.5; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form-inline label { flex: 1 1 180px; }
.form-inline button { flex: 0 0 auto; }
/* "Crear usuario": todo en UNA línea (Usuario · Contraseña · Rol · Crear).
   En pantallas estrechas se reparte en varias filas automáticamente. */
.crear-usuario { display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end; }
.crear-usuario label { flex: 1 1 150px; }
.crear-usuario .rol-label { flex: 1 1 150px; }
.crear-usuario .rol-label select { width: 100%; }
.crear-usuario button { flex: 0 0 auto; }
.composer { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.composer label { display: flex; flex-direction: column; gap: 7px; font-size: 12px;
  color: var(--suave); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2397A3BE' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; border: 1px solid var(--borde-fuerte);
  background: rgba(255,255,255,.04); color: var(--texto);
  padding: 11px 18px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  font-family: inherit; letter-spacing: .2px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { background: rgba(255,255,255,.09); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--glow); }
.btn-primary {
  background: var(--grad); border: none; color: #fff;
  box-shadow: 0 10px 26px -10px rgba(120,110,255,.8), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px);
  box-shadow: 0 16px 34px -12px rgba(120,110,255,.95), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-danger { background: rgba(255,122,122,.06); border-color: rgba(255,122,122,.3); color: #ffadad; }
.btn-danger:hover { background: var(--error); border-color: var(--error); color: #2a0c0c; }
.btn-ghost { background: transparent; border-color: var(--borde); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
form { margin: 0; }

/* ---- Tabla ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--linea); }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--tenue); font-weight: 700; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: rgba(255,255,255,.03); }
.tbl td.right, .tbl th.right { text-align: right; }
.tag { font-size: 10.5px; font-weight: 700; color: #ffd98a; border: 1px solid rgba(255,200,87,.32);
  background: rgba(255,200,87,.12); padding: 2px 9px; border-radius: 999px; margin-left: 8px; }
.links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.links a { font-weight: 600; color: var(--texto); display: block; padding: 11px 13px;
  border-radius: 11px; transition: background .14s ease, transform .12s ease; }
.links a:hover { background: rgba(255,255,255,.06); transform: translateX(3px); text-decoration: none; }

/* ---- Avisos ---- */
.alert {
  position: relative; border-radius: var(--r-sm); padding: 14px 18px 14px 18px;
  margin-bottom: 18px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; overflow: hidden;
}
.alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.alert-error { background: rgba(255,122,122,.10); color: #ffbcbc; border-color: rgba(255,122,122,.28); }
.alert-error::before { background: var(--error); }
.alert-ok { background: rgba(52,226,168,.10); color: #9af0d2; border-color: rgba(52,226,168,.28); }
.alert-ok::before { background: var(--ok); }
.alert-warn { background: rgba(255,200,87,.10); color: #ffe2a6; border-color: rgba(255,200,87,.26); }
.alert-warn::before { background: var(--aviso); }

/* ---- Login ---- */
.login-wrap { min-height: calc(100vh - 66px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 400px; max-width: 100%; text-align: center; padding: 36px 32px; }
.brand-big {
  font-family: var(--fuente-display); font-weight: 800; font-size: 38px; letter-spacing: -.5px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.login-card .sub { color: var(--suave); margin: 8px 0 26px; font-size: 13.5px; letter-spacing: .3px; }
.login-card .form { text-align: left; }
.login-card .btn-block { margin-top: 4px; }

/* ---- Composer (nuevo cierre) ---- */
.composer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }

/* Zona para arrastrar carpetas */
.dropzone {
  position: relative; border-radius: var(--r); padding: 30px 20px; text-align: center;
  background: var(--grad-soft); margin-bottom: 18px; cursor: default;
  border: 1.5px dashed var(--borde-fuerte);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.dropzone.dz-activo { border-color: var(--acento); background: rgba(110,139,255,.14); transform: scale(1.01); }
.dz-icono { font-size: 40px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
.dz-titulo { margin: 10px 0 4px; font-size: 15.5px; }
.dz-botones { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
#drop-info { margin-top: 12px; font-weight: 700; color: var(--ok); min-height: 18px; }
/* Botones de cada siniestro: si no caben a lo ancho (móvil), pasan a otra
   línea en vez de desbordar la tarjeta. */
.bib-acc { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- Filas de acciones (arreglar / comprobar / estado) ---- */
.acciones-fila, .reparar-fila { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.acciones-fila .small, .reparar-fila .small { margin-top: 0; }
.txt-aviso { color: var(--aviso); }

/* ---- Diagnóstico ---- */
.diag-lista { display: flex; flex-direction: column; gap: 9px; }
.diag-row { display: flex; gap: 12px; align-items: flex-start; background: var(--panel-2);
  border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px; }
.diag-ic { font-weight: 800; font-size: 17px; line-height: 1.35; }
.diag-ok .diag-ic { color: var(--ok); }
.diag-bad .diag-ic { color: var(--error); }
.diag-warn .diag-ic { color: var(--aviso); }
.diag-txt { min-width: 0; }

/* ---- Lista de carpetas seleccionadas ---- */
.lista-carpetas { display: flex; flex-direction: column; gap: 8px; }
.carpeta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--linea); border-radius: 12px; padding: 10px 14px;
  animation: surgir .3s ease both; }
.carpeta-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---- Cola y resultados ---- */
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
.cola-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cola-cab h2 { margin: 0; }
#cola-lista { display: flex; flex-direction: column; gap: 12px; }
.q-row {
  position: relative; background: var(--panel-2); border: 1px solid var(--linea);
  border-radius: 14px; padding: 14px 16px 14px 18px; overflow: hidden;
  animation: surgir .35s ease both;
}
.q-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--borde-fuerte); }
.q-row.qe-ok::before { background: var(--ok); }
.q-row.qe-err::before { background: var(--error); }
.q-row.qe-run::before { background: var(--grad); }
.q-row.qe-cola::before { background: var(--aviso); }
.q-row.qe-cancel::before { background: var(--tenue); }
.q-row.qe-run { box-shadow: 0 0 0 1px rgba(110,139,255,.22), 0 12px 30px -16px rgba(110,139,255,.5); }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-head strong { font-size: 15.5px; }
.q-badge { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: rgba(255,255,255,.05); color: var(--suave); white-space: nowrap; border: 1px solid var(--linea); }
.qe-ok .q-badge { color: var(--ok); border-color: rgba(52,226,168,.3); background: rgba(52,226,168,.10); }
.qe-err .q-badge { color: var(--error); border-color: rgba(255,122,122,.3); background: rgba(255,122,122,.10); }
.qe-run .q-badge { color: #b3c2ff; border-color: rgba(110,139,255,.35); background: rgba(110,139,255,.12); }
.qe-run .q-badge::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px;
  border-radius: 50%; background: var(--acento); animation: latir 1.1s ease-in-out infinite; vertical-align: middle; }
@keyframes latir { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.q-acc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---- Barra de progreso ---- */
.prog-wrap { margin-bottom: 14px; }
.prog-cab { display: flex; justify-content: space-between; font-size: 13px; color: var(--suave); margin-bottom: 8px; }
.prog-cab #prog-pct { color: var(--texto); font-weight: 700; }
.prog-barra { height: 12px; background: rgba(7,10,17,.8); border: 1px solid var(--linea); border-radius: 999px; overflow: hidden; }
.prog-relleno { position: relative; height: 100%; width: 0; border-radius: 999px;
  background: var(--grad); transition: width .5s cubic-bezier(.2,.7,.2,1); overflow: hidden; }
.prog-relleno::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  background-size: 200% 100%; animation: brillar 1.3s linear infinite; }
@keyframes brillar { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.prog-acciones { margin: 8px 0; }
.chrome-vista { margin: 10px 0 14px; }
.chrome-vista img { width: 100%; border: 1px solid var(--borde-fuerte); border-radius: 12px; background: var(--bg); display: block; }

/* ---- Log ---- */
.log-box {
  background: rgba(5,8,14,.85); border: 1px solid var(--linea); border-radius: 12px;
  padding: 14px 16px; height: 280px; overflow-y: auto;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.65;
}
.log-linea { white-space: pre-wrap; word-break: break-word; }
.log-info { color: var(--suave); }
.log-ok, .log-fin { color: var(--ok); }
.log-error { color: var(--error); }
.log-aviso { color: var(--aviso); }
.log-paso { color: #b79bff; }
.log-modelo, .log-cuenta { color: var(--tenue); }

/* ---- Tarjetas de resultado (compat) ---- */
.card-res { background: var(--panel-2); border: 1px solid var(--linea); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.res-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.res-ok .res-cab strong { color: var(--ok); }
.res-err .res-cab strong { color: var(--error); }
.badge { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--linea); }
.b-ok { color: var(--ok); }
.b-err { color: var(--error); }
.b-warn { color: var(--aviso); }
.small { font-size: 11.5px; margin-top: 3px; }
.res-err-txt { color: var(--suave); font-size: 13px; margin-top: 8px; }
.res-botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---- Cuentas de Claude (Ajustes) ---- */
.cuenta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--linea); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.cuenta-row.cuenta-pausada { opacity: 0.62; border-style: dashed; }
.cuenta-info { min-width: 0; }
.cuenta-btns { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.tabla-scroll { overflow-x: auto; border-radius: 12px; }

/* Acciones por usuario (pantalla Usuarios): bloque de ancho fijo alineado a la
   derecha, con filas que lo llenan → todas las filas de usuario quedan iguales. */
.acciones-usuario { width: 100%; max-width: 480px; margin-left: auto;
  display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.acciones-usuario form { width: 100%; margin: 0; }
.acc-pw { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.acc-pw .pw-vista { margin-right: auto; }
/* Reset de contraseña: campo a lo ancho y debajo (alineado a la derecha) el
   "pedir cambio" + "Restablecer". Predecible y ordenado a cualquier ancho. */
.form-reset { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.acc-reset-fila { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.form-reset input[type="text"] {
  width: 100%; background: rgba(7,10,17,.7); color: var(--texto);
  border: 1px solid var(--borde); border-radius: 9px; padding: 9px 11px; font-size: 13px; outline: none;
}
.form-reset input[type="text"]:focus { border-color: var(--acento); box-shadow: var(--glow); }
.form-reset input[type="text"]::placeholder { color: var(--tenue); }
.acc-borrar { text-align: right; }
.pw-vista { font-family: "JetBrains Mono", Consolas, monospace; }
.pw-vista:not(:empty) { background: rgba(110,139,255,.12); border: 1px solid rgba(110,139,255,.3);
  color: #cdd7ff; padding: 4px 10px; border-radius: 8px; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--suave); font-weight: 600; white-space: nowrap; }
.chk input { width: auto; }
.acciones-usuario .btn { white-space: nowrap; }

/* ---- Modal (vinculación remota / elegir cierre) ---- */
.rv-overlay { position: fixed; inset: 0; background: rgba(4,6,12,.7); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: aparecer .2s ease both; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.rv-box { background: var(--bg-2); border: 1px solid var(--borde-fuerte); border-radius: var(--r-lg);
  padding: 24px; width: 100%; max-width: 900px; max-height: 92vh; overflow: auto; box-shadow: var(--sombra-2);
  animation: surgir .25s ease both; }
.rv-box h2 { font-family: var(--fuente-display); margin: 0 0 8px; }
.rv-pantalla-cont { background: #000; border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; margin: 12px 0; min-height: 120px; text-align: center; }
#rv-pantalla { max-width: 100%; display: block; margin: 0 auto; cursor: crosshair; }
.rv-estado { font-weight: 700; color: var(--ok); margin: 4px 0 8px; }
.rv-paso { background: var(--panel-2); border: 1px solid var(--borde-fuerte); border-radius: 14px; padding: 16px; margin: 12px 0; }
.rv-paso label { display: block; font-size: 13px; color: var(--suave); font-weight: 600; margin-bottom: 8px; }
#rv-correo, #rv-codigo { width: 100%; background: rgba(7,10,17,.7); color: var(--texto);
  border: 1px solid var(--borde-fuerte); border-radius: 10px; padding: 12px 14px; font-size: 15px; outline: none; margin-bottom: 12px; }
#rv-correo:focus, #rv-codigo:focus { border-color: var(--acento); box-shadow: var(--glow); }
.rv-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---- Modal elegir cierre ---- */
.cierre-opciones { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.cierre-opt { text-align: left; align-items: flex-start; flex-direction: column; }

/* ---- Tutorial de bienvenida (coach marks con flechas) ---- */
#tour { position: fixed; inset: 0; z-index: 90; }
#tour-hueco { position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(4,6,12,.78), 0 0 0 3px var(--acento), 0 0 22px 4px rgba(110,139,255,.6);
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
#tour-card { position: fixed; width: 320px; max-width: calc(100vw - 24px);
  background: var(--bg-2); border: 1px solid var(--borde-fuerte); border-radius: 16px;
  padding: 14px 16px; box-shadow: var(--sombra-2); text-align: center;
  transition: top .2s ease, left .2s ease; }
.tour-arrow { position: absolute; width: 0; height: 0; border: 9px solid transparent; }
.tour-arrow.up { border-bottom-color: var(--bg-2); top: -18px; }
.tour-arrow.down { border-top-color: var(--bg-2); bottom: -18px; }
.tut-icono { display: none; }
#tour-card h3 { font-family: var(--fuente-display); font-size: 17px; margin: 2px 0 5px; }
#tut-texto { font-size: 13.5px; line-height: 1.5; margin: 4px 0; }
.tut-pasos { display: flex; gap: 6px; justify-content: center; margin-bottom: 4px; }
.tut-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--borde-fuerte); transition: all .2s ease; }
.tut-dot.on { background: var(--acento); width: 20px; border-radius: 6px; }
.tut-botones { display: flex; align-items: center; gap: 8px; margin-top: 16px; }

/* ---- Estado del sistema (Administración) ---- */
.stat-fila { display: flex; gap: 12px; margin: 4px 0; flex-wrap: wrap; }
.stat { flex: 1 1 120px; background: var(--panel-2); border: 1px solid var(--linea);
  border-radius: 12px; padding: 14px; text-align: center; }
.stat-num { display: block; font-family: var(--fuente-display); font-size: 24px; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-lbl { display: block; font-size: 12px; color: var(--suave); margin-top: 2px; }

/* ---- Ajustes ---- */
.aj-botones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.aj-ayuda li a { font-weight: 600; }

/* ---- Preferencias (Ajustes) ---- */
.pref { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel-2); border: 1px solid var(--linea); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; }
.pref input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--acento); cursor: pointer; }

/* ---- Sugerencias ---- */
.sug-form { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.sug-form textarea { background: rgba(7,10,17,.7); color: var(--texto); border: 1px solid var(--borde);
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 14px; font-family: inherit; resize: vertical; outline: none; }
.sug-form textarea:focus { border-color: var(--acento); box-shadow: var(--glow); }
.sug-form button { align-self: flex-start; }
#sug-lista { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; }
.sug-row { background: var(--panel-2); border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px; }
.sug-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sug-texto { font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.sug-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- Pie de soporte ---- */
.pie { max-width: 1100px; margin: 0 auto; padding: 22px 24px 44px; color: var(--tenue); font-size: 13px; text-align: center; }
.pie a { color: var(--suave); }

/* ---- Subir + buscar + opciones ---- */
#drop-avisos { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
#drop-avisos:empty { display: none; }
.txt-ok { color: var(--ok); }
.busca-label { display: flex; flex-direction: column; gap: 7px; font-size: 12px;
  color: var(--suave); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 10px; }
.busca-label input { background: rgba(7,10,17,.7); color: var(--texto); border: 1px solid var(--borde);
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; outline: none; text-transform: none; letter-spacing: normal; font-weight: 400; }
.busca-label input:focus { border-color: var(--acento); box-shadow: var(--glow); }
.opciones-proc { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--linea); }
.opciones-titulo { margin: 0 0 12px; text-transform: uppercase; letter-spacing: .5px; }

/* ---- Biblioteca: mis siniestros subidos ---- */
#bib-lista { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; margin-bottom: 4px; }
/* La fila del siniestro lleva 3 hijos: datos, botones y (al desplegar) la lista
   de archivos. Con "wrap" los dos primeros van arriba en una línea y la lista de
   archivos cae DEBAJO ocupando todo el ancho (si no, se aplastaba a la derecha). */
.bib-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px;
  animation: surgir .3s ease both; }
.bib-info { min-width: 0; flex: 1 1 200px; }
.bib-info strong { font-size: 15px; }
.bib-row .btn { flex-shrink: 0; }
/* Siniestro cuya carpeta ya no está en el servidor: se muestra atenuado y con
   aviso, y su botón "Poner en cola" queda desactivado. */
.bib-row-nodisp { opacity: .72; border-style: dashed; }

/* ---- Barra de histórico ---- */
.hist-barra { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.hist-barra input[type="text"] { flex: 1 1 260px; background: rgba(7,10,17,.7); color: var(--texto);
  border: 1px solid var(--borde); border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; outline: none; }
.hist-barra input[type="text"]:focus { border-color: var(--acento); box-shadow: var(--glow); }

/* =============================================================================
   Responsive
============================================================================= */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .span-2, .span-3 { grid-column: span 2; }
  .container { padding: 26px 18px 40px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .grid, .grid-1, .grid-2 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .composer-grid { grid-template-columns: 1fr; }
  .container { padding: 18px 13px 36px; }
  .page-title { font-size: 24px; }
  .card { padding: 18px; border-radius: 16px; }
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 16px; padding: 11px 16px; position: static; }
  .brand { font-size: 19px; }
  .nav { order: 3; width: 100%; gap: 4px; flex-wrap: wrap; }
  .userbox { margin-left: auto; gap: 8px; }
  .role-pill { display: none; }
  .btn { padding: 12px 16px; }
  .btn-sm { padding: 10px 14px; font-size: 14px; }
  .form input, .form select, .form textarea, .composer input, .composer select { padding: 13px 14px; font-size: 16px; }
  .q-acc .btn, .q-acc a.btn { flex: 1 1 auto; }
  /* Siniestros subidos: en pantalla estrecha, los botones a su propia línea. */
  .bib-acc { flex: 1 1 100%; justify-content: flex-start; }
  .login-card { width: 100%; padding: 28px 22px; }
  .rv-box { max-width: 100%; padding: 18px; border-radius: 16px; }
  .log-box { height: 220px; }
}

@media (max-width: 420px) {
  .nav { gap: 2px; font-size: 14px; }
  .q-head { flex-direction: column; align-items: flex-start; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Biblioteca "Mis siniestros subidos": cabecera + gestión de archivos sueltos */
.bib-hd { font-family: var(--fuente-display); font-size: 17px; margin: 18px 0 2px; }
.bib-files {
  /* Línea propia y ancho completo dentro de .bib-row (que es flex con wrap). */
  flex: 0 0 100%; width: 100%; min-width: 0; box-sizing: border-box;
  margin: 2px 0; padding: 8px 12px; border: 1px dashed var(--borde);
  border-radius: var(--r-sm); background: rgba(255,255,255,.02);
  max-height: 240px; overflow-y: auto;
}
.bib-file {
  display: flex; align-items: center; gap: 10px; padding: 6px 2px;
  border-bottom: 1px solid var(--linea);
}
.bib-file:last-child { border-bottom: 0; }
.bib-file-nom { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; }
.bib-file-tam { white-space: nowrap; flex-shrink: 0; }
.bib-file .btn { flex-shrink: 0; }
