/* styles.css — Sistema visual de Quantia.
 *
 * Lenguaje: neutro primero. Negro para acciones primarias, estado activo y
 * títulos; blanco para las tarjetas; gris claro para el lienzo. El color
 * aparece sólo como acento: un lavanda suave para la marca, y cuatro tintes
 * pastel (lavanda, menta, rosa, celeste) reservados para las CATEGORÍAS de
 * la lista de materiales y para los estados. Nada saturado.
 *
 * Radio grande y consistente: tarjetas 16px, botones y badges en píldora,
 * botones de ícono redondos. Nada con esquina viva.
 *
 * Profundidad por contraste (tarjeta blanca sobre lienzo gris), no por
 * sombras: las sombras existen sólo en capas flotantes (modal, dropdown,
 * toast). Bordes finos y claros, usados con moderación.
 *
 * Densidad: es una herramienta interna. El aire está en el radio, el color y
 * la tipografía, NO en el padding: las tablas siguen siendo compactas para
 * poder ver muchas filas de una lista de materiales sin scrollear.
 */

:root {
  /* ---- Lienzo y superficies ---- */
  --bg: #f2f2f4;
  --bg-sidebar: #fafafb;
  --panel: #ffffff;
  --panel-soft: #f6f6f9;
  --border: #ebebf0;
  --border-strong: #dcdce4;

  /* ---- Tinta ---- */
  --text: #15151b;
  --text-muted: #7a7a8c;
  --text-soft: #a2a2b2;

  /* ---- Primario: negro ---- */
  --ink: #15151b;
  --ink-hover: #30303c;

  /* ---- Acento: lavanda (marca, foco, detalles) ---- */
  --accent: #6d61e0;
  --accent-soft: #edebfd;
  --accent-ink: #4f45b5;

  /* ---- Los cuatro pastel de categoría ----
   * `tint` = relleno (fondos de fila de grupo, píldoras)
   * `mid`  = versión legible a 6px (puntos, barras de composición) */
  --tint-lavender: #ece9fc;  --mid-lavender: #8b7ff0;  --ink-lavender: #5348b8;
  --tint-mint:     #ddf2e8;  --mid-mint:     #5fb99a;  --ink-mint:     #2c7a5c;
  --tint-blush:    #fbe6e7;  --mid-blush:    #e08a90;  --ink-blush:    #b4535a;
  --tint-sky:      #dfedfa;  --mid-sky:      #74add8;  --ink-sky:      #2f6b96;
  --tint-sand:     #faf1dc;  --mid-sand:     #d8b872;  --ink-sand:     #8d6b1f;
  --mid-obra: #b9b9c6;       /* mano de obra: gris, no es una categoría de material */

  /* ---- Semántico (reusa los pastel) ---- */
  --danger: var(--ink-blush);    --danger-bg: var(--tint-blush);
  --warn: var(--ink-sand);       --warn-bg: var(--tint-sand);
  --ok: var(--ink-mint);         --ok-bg: var(--tint-mint);
  --info: var(--ink-sky);        --info-bg: var(--tint-sky);

  /* ---- Forma ---- */
  --radius-card: 16px;
  --radius: 10px;
  --radius-pill: 999px;

  /* ---- Elevación (sólo capas flotantes) ---- */
  --shadow-pop: 0 16px 40px rgba(18, 18, 30, 0.12), 0 2px 8px rgba(18, 18, 30, 0.05);

  /* ---- Tipografía ---- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
               system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* `ui-rounded` da SF Pro Rounded en macOS; en Windows cae a Segoe UI. */
  --font-display: ui-rounded, "Segoe UI Variable Display", -apple-system, BlinkMacSystemFont,
                  "Segoe UI", system-ui, sans-serif;

  --sidebar-w: 232px;
  --sidebar-w-collapsed: 60px;
  font-size: 14px;
}

* { box-sizing: border-box; }
/* El atributo `hidden` tiene que ganarle a reglas de clase como `.wq-field { display:flex }`. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbars finas, al tono del lienzo. */
* { scrollbar-width: thin; scrollbar-color: #d3d3dd transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d3d3dd; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #bcbcca; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

#wq-app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
/* En Inicio (el hub de módulos) el panel no aparece: esa pantalla ES la
   navegación, así que mostrarlo también sería redundante. */
#wq-app.wq-no-sidebar .wq-sidebar { display: none; }

.wq-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  padding: 18px 0 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.15s, flex-basis 0.15s;
}
/* Colapsado: sólo íconos. El texto no se saca del DOM (para no tocar el
   nav de index.html fila por fila) — se lo angosta a 0 con font-size, el
   ícono no se mueve porque su tamaño está fijado aparte (16px, ver abajo). */
#wq-app.wq-sidebar-collapsed .wq-sidebar { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }
#wq-app.wq-sidebar-collapsed .wq-brand { justify-content: center; padding: 0 0 20px; }
#wq-app.wq-sidebar-collapsed .wq-brand span:not(.wq-brand-mark) { display: none; }
#wq-app.wq-sidebar-collapsed .wq-nav-section { display: none; }
#wq-app.wq-sidebar-collapsed .wq-nav a { justify-content: center; gap: 0; padding: 8px; font-size: 0; }

.wq-sidebar-toggle {
  position: absolute;
  top: 20px;
  right: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  z-index: 5;
}
.wq-sidebar-toggle:hover { color: var(--text); background: var(--panel-soft); }
.wq-sidebar-toggle svg { width: 13px; height: 13px; transition: transform 0.15s; }
#wq-app.wq-sidebar-collapsed .wq-sidebar-toggle svg { transform: rotate(180deg); }

.wq-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.wq-brand-mark {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wq-brand small {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--text-soft);
  margin-top: 1px;
}
.wq-nav { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; }
.wq-nav-section {
  padding: 14px 22px 5px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
}
.wq-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 10px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.wq-nav a svg { flex: 0 0 16px; width: 16px; height: 16px; opacity: 0.7; }
.wq-nav a:hover { background: rgba(21, 21, 27, 0.05); color: var(--text); }
.wq-nav a:hover svg { opacity: 0.9; }
.wq-nav a.active { background: var(--ink); color: #fff; font-weight: 600; }
.wq-nav a.active svg { opacity: 1; }

/* ---- Main ---- */
.wq-main {
  flex: 1;
  min-width: 0;
  padding: 24px 26px 60px;
  overflow-x: auto;
}
.wq-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.wq-header-row h1 {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}
.wq-header-row .wq-sub { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; }
.wq-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.wq-breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.wq-breadcrumb a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.wq-breadcrumb a:hover { color: var(--text); border-bottom-color: var(--text-muted); }

/* ---- Botones: siempre píldora ---- */
button, .wq-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  padding: 7px 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover, .wq-btn:hover { background: var(--panel-soft); border-color: #cbcbd7; }
button.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
button.danger { color: var(--danger); border-color: var(--border-strong); }
button.danger:hover { background: var(--danger-bg); border-color: #f0cfd1; }
/* Secundario: píldora de relleno suave, sin borde. Da forma sin competir
   con el negro del primario. */
button.ghost { border-color: transparent; background: var(--panel-soft); color: var(--text-muted); }
button.ghost:hover { background: #eaeaf1; border-color: transparent; color: var(--text); }
button.ghost.danger:hover { background: var(--danger-bg); color: var(--danger); }
button.small { padding: 4px 11px; font-size: 12px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
/* Botón de ícono: círculo perfecto. */
button.icon {
  width: 30px; height: 30px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

/* ---- Panels / cards ---- */
.wq-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.wq-panel h2 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0 0 12px;
}
.wq-panel h3 {
  font-size: 10.5px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ---- Tablas (compactas a propósito) ---- */
table.wq-table {
  width: 100%;
  border-collapse: separate;   /* permite radio en las celdas de grupo */
  border-spacing: 0;
  font-size: 13px;
}
table.wq-table th, table.wq-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.wq-table th {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
table.wq-table tbody tr:hover { background: var(--panel-soft); }
table.wq-table tbody tr:last-child td { border-bottom: none; }
table.wq-table td.num, table.wq-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.wq-table td.actions { white-space: nowrap; text-align: right; }
/* Acciones de fila: píldoras suaves, para que se lean como controles y no
   como texto suelto (equivalente en texto al botón de ícono redondo). */
table.wq-table td.actions button {
  background: var(--panel-soft);
  border-color: transparent;
  color: var(--text-muted);
}
table.wq-table td.actions button:hover { background: #eaeaf1; color: var(--text); }
table.wq-table td.actions button.danger:hover { background: var(--danger-bg); color: var(--danger); }
table.wq-table a { color: var(--text); text-decoration: none; }
table.wq-table a:hover { color: var(--accent-ink); }
.wq-empty { color: var(--text-muted); padding: 22px 4px; font-size: 13px; }

/* Fila de encabezado de grupo, teñida por categoría de la lista de materiales. */
.wq-group-row td, td.wq-group-head {
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none !important;
  padding: 9px 12px !important;
}
/* Cajón desplegable con la lista de materiales de una ventana. */
table.wq-table tr.wq-row-open > td { background: var(--panel-soft); }
table.wq-table tr.wq-row-open > td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
.wq-v-detail-row > td { padding: 0 !important; background: var(--panel); }
.wq-v-detail-row:hover > td { background: var(--panel); }
.wq-v-detail-body { padding: 4px 12px 22px; }

/* Acciones por línea en la lista de materiales de una ventana. */
.wq-bom-acc { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.wq-bom-acc button { padding: 3px 9px; font-size: 11.5px; }
table.wq-table td.wq-precio-manual { color: var(--warn); font-weight: 600; }
table.wq-table tr.wq-bom-excluida:hover { background: transparent; }

td.wq-cat-perfil    { background: var(--tint-lavender); color: var(--ink-lavender); }
td.wq-cat-material  { background: var(--tint-mint);     color: var(--ink-mint); }
td.wq-cat-accesorio { background: var(--tint-blush);    color: var(--ink-blush); }
td.wq-cat-insumo    { background: var(--tint-sky);      color: var(--ink-sky); }

/* ---- Punto de categoría + barra de composición ---- */
.wq-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
  background: var(--border-strong);
}
.wq-dot-perfil    { background: var(--mid-lavender); }
.wq-dot-material  { background: var(--mid-mint); }
.wq-dot-accesorio { background: var(--mid-blush); }
.wq-dot-insumo    { background: var(--mid-sky); }
.wq-dot-obra      { background: #b9b9c6; }

/* Barra fina, totalmente redondeada, de dos tonos. */
.wq-bar {
  display: flex;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
  margin: 18px 0 12px;
}
.wq-bar > i { display: block; height: 100%; background: var(--border-strong); }
.wq-bar > i + i { box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.85); }

/* ---- Formularios ---- */
.wq-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; }
.wq-field span:first-child { font-weight: 600; color: var(--text); font-size: 12px; }
.wq-field input, .wq-field select, .wq-field textarea {
  font: inherit;
  font-size: 13px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wq-field input::placeholder, .wq-field textarea::placeholder { color: var(--text-soft); }
.wq-field input:focus, .wq-field select:focus, .wq-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 97, 224, 0.16);
}
.wq-field-error { color: var(--danger); font-size: 11.5px; min-height: 14px; }
/* El botón nativo de <input type="file"> es la única esquina viva que queda. */
input[type="file"] { font: inherit; font-size: 13px; color: var(--text-muted); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-right: 10px;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
}
input[type="file"]::file-selector-button:hover { background: var(--panel-soft); border-color: #cbcbd7; }
.wq-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.wq-form-grid .wq-field-wide { grid-column: 1 / -1; }
/* Jerarquía por espacio, no por líneas divisorias. */
.wq-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; padding-top: 14px; }

/* ---- Modal ---- */
.wq-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 16, 26, 0.32);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; overflow-y: auto; z-index: 1000;
}
.wq-modal {
  background: var(--panel);
  border-radius: 20px;
  width: 520px; max-width: 100%;
  box-shadow: var(--shadow-pop);
}
.wq-modal-wide { width: 820px; }
.wq-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}
.wq-modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.wq-modal-close {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
  font-size: 17px; line-height: 1;
  color: var(--text-muted);
}
.wq-modal-close:hover { background: #ededf2; color: var(--text); }
.wq-modal-body { padding: 6px 18px 18px; max-height: 78vh; overflow-y: auto; }

/* ---- Badges / avisos ---- */
.wq-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}
.wq-badge-a, .wq-badge-lavender { background: var(--tint-lavender); color: var(--ink-lavender); }
.wq-badge-b, .wq-badge-neutral  { background: var(--panel-soft); color: var(--text-muted); }
.wq-badge-mint  { background: var(--tint-mint);  color: var(--ink-mint); }
.wq-badge-blush { background: var(--tint-blush); color: var(--ink-blush); }
.wq-badge-sky   { background: var(--tint-sky);   color: var(--ink-sky); }
.wq-badge-ok    { background: var(--ok-bg);      color: var(--ok); }
.wq-badge-warn  { background: var(--warn-bg);    color: var(--warn); }
.wq-badge-danger{ background: var(--danger-bg);  color: var(--danger); }

.wq-notice {
  border-radius: var(--radius-card);
  padding: 11px 15px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.wq-notice strong { font-weight: 600; }
.wq-notice-warn   { background: var(--warn-bg);   color: var(--warn);   border-color: #f0e2c2; }
.wq-notice-danger { background: var(--danger-bg); color: var(--danger); border-color: #f3d3d5; }
.wq-notice-info   { background: var(--info-bg);   color: var(--info);   border-color: #cee1f3; }
.wq-notice a { color: inherit; font-weight: 600; }

/* ---- Toasts: papel claro flotando, punto de color por tipo ---- */
#wq-toasts { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.wq-toast {
  display: flex;
  align-items: center;
  background: var(--panel);
  color: var(--text);
  padding: 11px 17px 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  font-size: 13px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: var(--shadow-pop);
  max-width: 340px;
}
.wq-toast::before {
  content: "";
  flex: 0 0 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mid-sky);
  margin-right: 10px;
}
.wq-toast.show { opacity: 1; transform: translateY(0); }
.wq-toast-success::before { background: var(--mid-mint); }
.wq-toast-error::before { background: var(--mid-blush); }

/* ---- Misc ---- */
.wq-muted { color: var(--text-muted); }
.wq-mono { font-variant-numeric: tabular-nums; }
.wq-tag {
  display: inline-block;
  background: var(--panel-soft);
  color: var(--text-muted);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
}
.wq-row-condicion { font-size: 11.5px; color: var(--text-muted); }
.wq-inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.wq-inline-form input, .wq-inline-form select {
  font: inherit; font-size: 13px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}
.wq-inline-form input:focus, .wq-inline-form select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 97, 224, 0.16);
}
.wq-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.wq-total-line { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 13.5px; }
.wq-total-line > span:last-child { font-variant-numeric: tabular-nums; }
.wq-total-line.grand {
  font-weight: 700;
  font-size: 16.5px;
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  border-top: 1px solid var(--border-strong);
  margin-top: 8px;
  padding-top: 11px;
}
.wq-search {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  font: inherit;
  font-size: 13px;
  color: var(--text);
  width: 220px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.wq-search::placeholder { color: var(--text-soft); }
.wq-search:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 97, 224, 0.16);
}
/* Filtro de la cabecera: mismo lenguaje que .wq-search (píldora de relleno
   suave), para que filtrar y buscar se lean como el mismo tipo de control. */
.wq-filter {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  font: inherit;
  font-size: 13px;
  color: var(--text);
  max-width: 260px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.wq-filter:hover { background: #eaeaf1; }
.wq-filter:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 97, 224, 0.16);
}
.wq-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wq-option-group {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.wq-choice-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 3px 8px 3px 13px;
  margin: 2px 6px 2px 0;
  font-size: 12.5px;
}
.wq-choice-chip button {
  border: none; background: transparent;
  padding: 0; width: 18px; height: 18px;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-soft); font-size: 14px;
}
.wq-choice-chip button:hover { background: var(--panel-soft); color: var(--text); }

/* ---- Inicio / módulos ---- */
.wq-modulos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  max-width: 780px;
}
.wq-modulo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
a.wq-modulo:hover { border-color: var(--border-strong); background: var(--panel-soft); }
.wq-modulo.is-soon { opacity: 0.65; }
.wq-modulo-mark {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-soft);
  color: var(--text-muted);
  margin-bottom: 2px;
}
.wq-modulo-mark svg { width: 20px; height: 20px; }
.wq-modulo-mark-aluminio { background: var(--accent-soft); color: var(--accent-ink); }
.wq-modulo-nombre {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.012em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wq-modulo-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.wq-modulo-cta { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }

/* ---- Combobox con búsqueda (ui-common.js) ---- */
.wq-combo input {
  width: 100%;
  font: inherit; font-size: 13px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}
.wq-combo input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 97, 224, 0.16);
}
.wq-combo-item { border-radius: 8px; margin: 2px 4px; }

/* ---- Auth gate (login/registro) ---- */
.wq-auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.wq-auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  padding: 32px 28px;
}
.wq-auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.wq-auth-brand .wq-brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.wq-auth-card h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 4px;
  color: var(--ink);
}
.wq-auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}
.wq-auth-card form { display: flex; flex-direction: column; }
.wq-auth-card button[type="submit"] { margin-top: 6px; width: 100%; justify-content: center; }
.wq-auth-toggle {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 18px;
}
.wq-auth-toggle button {
  border: none; background: none; padding: 0;
  color: var(--accent-ink); font-weight: 600; cursor: pointer;
  border-radius: 0;
}
.wq-auth-toggle button:hover { background: none; text-decoration: underline; }
