/* ERP Taller · Estilo A (claro y limpio) */
:root {
  --fondo: #F5F6F8;
  --superficie: #FFFFFF;
  --borde: #E4E7EC;
  --borde-fuerte: #D0D5DD;
  --texto: #101828;
  --texto-2: #344054;
  --texto-suave: #475467;
  --hover: #F2F4F7;
  --acento: #1F5BD8;
  --acento-oscuro: #1846A8;
  --acento-suave: #E8EFFD;
  --ancho-menu: 272px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto); font-family: Inter, system-ui, sans-serif; font-size: 14px; }
a { color: var(--acento); }
a:hover { color: var(--acento-oscuro); }
h1 { margin: 0; font-size: 24px; font-weight: 700; }
h2 { margin: 0; font-size: 16px; font-weight: 700; }
code { background: var(--hover); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.texto-suave { color: var(--texto-suave); margin: 4px 0 0; line-height: 1.5; }

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

/* ---------- menú lateral ---------- */
.lateral {
  width: var(--ancho-menu); flex: none; background: var(--superficie); border-right: 1px solid var(--borde);
  display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; }
.marca-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--acento); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.marca-texto { display: flex; flex-direction: column; min-width: 0; }
.marca-texto strong { font-size: 15px; }
.marca-texto small { font-size: 12px; color: var(--texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu { flex: 1; overflow-y: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.menu-enlace, .menu-cabecera {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--texto-2); text-decoration: none; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-enlace:hover, .menu-cabecera:hover { background: var(--hover); color: var(--texto); }
.menu-enlace.activo { background: var(--acento-suave); color: var(--acento-oscuro); }
.menu-cabecera span { flex: 1; }
.menu-flecha { transition: transform .2s ease; color: var(--texto-suave); }
.menu-grupo.abierto > .menu-cabecera .menu-flecha { transform: rotate(180deg); }
.menu-grupo.abierto > .menu-cabecera { color: var(--texto); }
.etiqueta { font-style: normal; font-size: 11px; font-weight: 600; color: var(--texto-suave); background: var(--hover); border-radius: 999px; padding: 1px 8px; }

.menu-lista { display: none; flex-direction: column; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--borde); }
.menu-grupo.abierto > .menu-lista { display: flex; }
.menu-subtitulo { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--texto-suave); padding: 12px 10px 4px; }
.menu-subtitulo:first-child { padding-top: 4px; }
.menu-item { display: flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 6px; color: var(--texto-2); text-decoration: none; }
.menu-item:hover { background: var(--hover); color: var(--texto); }
.menu-item.activo { background: var(--acento-suave); color: var(--acento-oscuro); font-weight: 600; }
.menu .sin-coincidencia { display: none !important; }

.lateral-usuario { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--borde); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--hover); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--texto-2); flex: none; }
.lateral-usuario-texto { display: flex; flex-direction: column; font-size: 13px; }
.lateral-usuario-texto a { font-size: 12px; text-decoration: none; }

/* ---------- barra superior ---------- */
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barra { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: var(--superficie); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 5; }
.buscador { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border: 1px solid var(--borde-fuerte); border-radius: 10px; color: var(--texto-suave); background: var(--superficie); }
.buscador input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; color: var(--texto); background: transparent; }
.buscador:focus-within { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
kbd { font: inherit; font-size: 12px; border: 1px solid var(--borde); border-radius: 6px; padding: 1px 6px; }
.btn-icono { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--borde); background: var(--superficie); color: var(--texto-2); display: grid; place-items: center; cursor: pointer; }
.solo-movil { display: none; }

/* ---------- contenido ---------- */
.contenido { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }
.encabezado { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; justify-content: space-between; }
.migas { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--texto-suave); }
.migas strong { color: var(--texto); font-weight: 600; }
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; padding: 20px; }
.tarjetas-catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lista-enlaces { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.lista-enlaces a { display: block; padding: 8px 0; border-top: 1px solid var(--hover); text-decoration: none; color: var(--texto-2); font-weight: 500; }
.lista-enlaces a:hover { color: var(--acento); }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--borde-fuerte); background: var(--superficie); color: var(--texto-2); }
.btn-primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-primario:hover { background: var(--acento-oscuro); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.tabla-herramientas { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--borde); }
.campo-buscar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--borde-fuerte); border-radius: 8px; color: var(--texto-suave); width: min(360px, 100%); }
.campo-buscar input { border: 0; outline: 0; font: inherit; flex: 1; min-width: 0; background: transparent; color: var(--texto); }
.vacio { text-align: center; padding: 48px 16px; }

/* ---------- celular y tablet ---------- */
@media (max-width: 900px) {
  .lateral { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(16,24,40,.2); }
  .lateral.visible { transform: none; }
  .velo { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 15; }
  .solo-movil { display: grid; }
  .barra, .contenido { padding-left: 16px; padding-right: 16px; }
  kbd { display: none; }
}
