/* client/src/styles/v211.css — v2.11 Capa «moderna y minimalista»
   Se carga al final y sólo refina forma, espacios y tipografía; los colores
   salen de las variables del tema (Parámetros → Tema), así que funciona con
   cualquiera. Tema por omisión: «Moderno» (parameters.js).
   Sin tipografías externas: se usa la del sistema (más rápida y sin
   depender de otro dominio; ver R2-12 en AUDITORIA-PRODUCCION.md). */

:root {
  --radius: 8px;
  --radius-lg: 12px;
  --topbar-h: 56px;
  --sidebar-w: 244px;
  --shadow:    0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, .16);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

body {
  font-size: 14px;
  letter-spacing: -0.003em;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ── Barra lateral ───────────────────────────────────────────────── */
#sidebar { border-right: 1px solid rgba(255,255,255,.06); }
.sidebar-brand { padding: 18px 18px 14px; border-bottom: 0; }
.sidebar-logo { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; gap: 10px; }
.sidebar-logo-icon {
  width: 30px; height: 30px; border-radius: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0;
  background: var(--accent); box-shadow: none;
  font-family: var(--font-body); font-style: normal; text-shadow: none;
}
.sidebar-brand-sub { font-size: 10px; letter-spacing: .08em; margin-top: 8px; color: rgba(255,255,255,.38); }
.sidebar-section { padding: 10px 0 2px; }
.sidebar-section-label {
  font-family: var(--font-body); font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  color: rgba(255,255,255,.38); padding: 6px 18px 6px;
}
.nav-item {
  margin: 1px 10px; padding: 8px 10px; border-left: 0; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.72);
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--accent3); }
.nav-icon { font-size: 14px; opacity: .9; filter: saturate(.6); }
.nav-num { background: rgba(255,255,255,.1); border-radius: 4px; padding: 0 5px; font-size: 10px; }
.nav-kbd { border-color: rgba(255,255,255,.22); border-radius: 4px; }
.sidebar-footer { font-family: var(--font-body); font-size: 11px; color: rgba(255,255,255,.34); padding: 12px 18px; border-top-color: rgba(255,255,255,.06); }

/* ── Barra superior ──────────────────────────────────────────────── */
#topbar { box-shadow: none; padding: 0 24px; gap: 12px; }
#topbar-brand { font-size: 13px; }
#topbar-breadcrumb { font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
#topbar-time { font-size: 12px; font-variant-numeric: tabular-nums; }
.user-chip-btn { border-radius: 999px; padding: 3px 12px 3px 3px; }
.user-avatar { font-family: var(--font-body); font-size: 11px; font-weight: 650; }
.user-menu { border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; }

/* ── Página ──────────────────────────────────────────────────────── */
.p-page { padding: 28px 28px 40px; }
.page-header { margin-bottom: 20px; }
.page-title { font-family: var(--font-body); font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }

.card { border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card-title { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.stat-label { letter-spacing: .05em; }
.empty-state { color: var(--text-muted); }

/* ── Tablas ──────────────────────────────────────────────────────── */
.data-table { font-size: 13.5px; }
.data-table th {
  background: transparent; font-family: var(--font-body); font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 12px; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.data-table .num { font-variant-numeric: tabular-nums; }

/* ── Botones ─────────────────────────────────────────────────────── */
.btn {
  border-radius: 8px; padding: 8px 14px; font-weight: 550; font-size: 13.5px; letter-spacing: -0.003em;
  transition: filter .12s, box-shadow .12s, transform .08s, background .12s;
}
.btn:hover { opacity: 1; filter: brightness(.95); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .fn-chip:focus-visible, .cm-item:focus-visible,
.nav-item:focus-visible, .fn-preset:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { border-radius: 7px; }

/* ── Formularios ─────────────────────────────────────────────────── */
.field-label { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.field-hint { font-size: 12px; }
.input { border-width: 1px; border-radius: 8px; padding: 9px 11px; font-size: 14px; }
.input:hover:not(:disabled):not(:focus) { border-color: var(--border-dark); }
.input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.filter-btn { border-width: 1px; }

/* ── Ventanas ────────────────────────────────────────────────────── */
.modal-overlay { background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px); }
.modal-box { border-radius: 14px; border: 1px solid var(--border); }
.modal-header { background: var(--surface); padding: 16px 20px; }
.modal-title { font-family: var(--font-body); font-size: 16px; font-weight: 650; letter-spacing: -0.01em; font-style: normal; }
.modal-body { padding: 18px 20px; }
.modal-footer { background: var(--surface); padding: 14px 20px; }
.vl-toast { border-radius: 10px !important; font-weight: 550 !important; box-shadow: var(--shadow-md) !important; }

/* ── Ingreso ─────────────────────────────────────────────────────── */
.auth-screen { background: var(--bg); }
.auth-card { max-width: 380px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 32px 30px 24px; }
.auth-logo { width: 48px; height: 48px; border-radius: 12px; font: 700 18px var(--font-body); letter-spacing: 0; }
.auth-title { font: 650 22px var(--font-body); letter-spacing: -0.02em; color: var(--text); }
.auth-submit { border-radius: 10px; min-height: 44px; font-weight: 600; }

/* ── Pantalla de carga ───────────────────────────────────────────── */
#seed-screen { background: var(--bg) !important; color: var(--text) !important; }
#seed-screen .seed-logo { background: var(--accent); color: var(--on-accent); border-radius: 14px; box-shadow: none; font-family: var(--font-body); }
#seed-screen .seed-title { color: var(--text); font-family: var(--font-body); font-weight: 650; letter-spacing: -0.02em; }
#seed-screen .seed-sub, #seed-screen .seed-msg, #seed-screen .seed-version-tag { color: var(--text-muted); font-family: var(--font-body); }
#seed-screen .seed-bar-wrap { background: var(--bg-alt); }
#seed-screen .seed-bar { background: var(--accent); }

/* ── Menú Principal: misma numeración y teclas del Clipper, forma limpia ── */
.cm-screen {
  max-width: 620px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-md);
  padding: 22px 22px 16px; font-family: var(--font-body);
}
.cm-head { font-size: 12px; color: var(--text-muted); opacity: 1; }
.cm-title { margin: 14px 0 12px; font: 650 19px var(--font-body); letter-spacing: -0.01em; text-transform: none; color: var(--text); text-align: left; }
.cm-crumb { color: var(--accent); font-family: var(--font-mono); font-weight: 600; }
.cm-box { border: 0; padding: 0; gap: 2px; }
.cm-item { font: 500 14.5px var(--font-body); padding: 10px 12px; border-radius: 10px; gap: 12px; color: var(--text); }
.cm-item.active, .cm-item:focus-visible { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--text); }
.cm-n {
  min-width: 34px; text-align: center; font: 600 12.5px var(--font-mono);
  color: var(--text-muted); background: var(--bg-alt); border-radius: 6px; padding: 3px 0;
}
.cm-item.active .cm-n { background: var(--accent); color: var(--on-accent); }
.cm-sep { display: none; }
.cm-new { background: transparent; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; padding: 1px 8px; font-size: 10px; letter-spacing: .04em; }
.cm-arrow { color: var(--text-light); }
.cm-back { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; opacity: 1; color: var(--text-muted); }
.cm-keys { justify-content: flex-start; color: var(--text-muted); opacity: 1; margin-top: 14px; }
.cm-keys kbd { border-color: var(--border-dark); border-radius: 5px; padding: 1px 5px; background: var(--bg); }
.cm-foot { text-align: left; color: var(--text-light); opacity: 1; }

/* ── «03 Menú Cotización» dentro de la cotización ─────────────────── */
.cq-menu { display: flex; flex-direction: column; gap: 2px; outline: none; }
.cq-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: 10px; padding: 10px 12px; color: var(--text); font: 500 14.5px var(--font-body);
}
.cq-menu-item.active, .cq-menu-item:focus-visible { background: color-mix(in srgb, var(--accent) 9%, transparent); outline: none; }
.cq-menu-n { min-width: 34px; text-align: center; font: 600 12.5px var(--font-mono); color: var(--text-muted); background: var(--bg-alt); border-radius: 6px; padding: 3px 0; }
.cq-menu-item.active .cq-menu-n { background: var(--accent); color: var(--on-accent); }

/* ── Chips, tarjetas de piezas y lienzo ──────────────────────────── */
.fn-chip { border-radius: 999px; border-color: var(--border); padding: 6px 13px; }
.fn-chip.active { background: var(--accent); border-color: var(--accent); }
.fn-preset { border-radius: 12px; }
.fn-canvas-wrap { border-width: 1px; border-color: var(--border); border-radius: 14px; background: var(--surface); }
.fn-guides line { stroke: var(--bg-alt); }
.fn-ink path { stroke: var(--accent); stroke-width: 5; }
.fn-num { border-radius: 999px; }
.fn-preview-name { font-weight: 650; letter-spacing: -0.01em; }

/* ── Barras de desplazamiento discretas ──────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }

@media (max-width: 767px) {
  .p-page { padding: 16px 14px 28px; }
  #topbar { padding: 0 14px; }
  .cm-screen { padding: 16px 12px 12px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .btn, .nav-item, .input { transition: none; } }

/* ── Sin adornos: se quitan los degradados y brillos de versiones anteriores ── */
#topbar::after { display: none; }
.card:hover { box-shadow: var(--shadow); }
.stat-card::before { display: none; }
.item-tag { background: var(--accent); letter-spacing: 0; border-radius: 6px; }
.seed-bar { background: var(--accent) !important; }
.totals-row.total { border-radius: 10px; }
