/* ══════════════════════════════════════════════════════════
   MODELH SYSTEM — ESTILO COMPARTIDO

   Solo lo que es idéntico en todas las aplicaciones: los colores,
   la tipografía, los botones, los avisos y la barra superior.

   Cada aplicación carga su propio <style> DESPUÉS de este archivo,
   así que puede cambiar cualquier cosa de aquí sin pelearse.
   ══════════════════════════════════════════════════════════ */

:root {
  --bg: #0e0f11;
  --bg2: #161719;
  --bg3: #1e2023;
  --border: #2a2c30;
  --border2: #343639;
  --text: #e8e9ea;
  --text2: #9a9ca0;
  --text3: #5a5c60;
  --accent: #d4f53c;
  --accent2: #a8c42e;
  --red: #ff5c5c;
  --orange: #ff9a3c;
  --blue: #5c9dff;
  --green: #3cffa0;
  --morado: #a78bfa;
  --font: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --r: 10px;
  --r2: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── BOTONES ─────────────────────────────────────────────── */
.btn { border: none; border-radius: var(--r2); padding: 8px 14px; font-size: 13px; font-family: var(--font); cursor: pointer; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: #0e0f11; font-weight: 500; }
.btn-primary:hover { background: var(--accent2); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); }

/* ── AVISOS ──────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r); padding: 12px 16px; font-size: 13px; z-index: 400; transform: translateY(80px); opacity: 0; transition: all 0.25s; max-width: 320px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--red); }

.loading { padding: 48px; text-align: center; color: var(--text3); font-family: var(--mono); font-size: 12px; }

/* ── BARRA SUPERIOR COMPARTIDA ───────────────────────────── */
/* La pinta MH.pintarBarra() en todas las aplicaciones. */
.mh-barra { display: none; align-items: center; gap: 12px; }
.mh-volver { display: flex; align-items: center; gap: 5px; font-size: 11px; font-family: var(--mono); color: var(--text3); text-decoration: none; border: 1px solid var(--border); border-radius: var(--r2); padding: 4px 9px; transition: all 0.15s; }
.mh-volver:hover { color: var(--accent); border-color: var(--accent); }
.mh-apps { position: relative; }
.mh-apps-btn { font-size: 11px; font-family: var(--mono); color: var(--text3); background: none; border: 1px solid var(--border); border-radius: var(--r2); padding: 4px 9px; cursor: pointer; transition: all 0.15s; }
.mh-apps-btn:hover { color: var(--text); border-color: var(--border2); }
.mh-apps-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r2); min-width: 190px; z-index: 90; box-shadow: 0 8px 24px rgba(0,0,0,0.45); overflow: hidden; }
.mh-apps-menu.hidden { display: none; }
.mh-apps-menu a { display: flex; align-items: center; gap: 9px; padding: 9px 13px; font-size: 12px; color: var(--text2); text-decoration: none; transition: all 0.12s; }
.mh-apps-menu a:hover { background: var(--bg3); color: var(--text); }
.mh-punto { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.mh-correo { font-size: 11px; color: var(--text3); font-family: var(--mono); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-salir { font-size: 11px; color: var(--text3); font-family: var(--mono); background: none; border: 1px solid var(--border); border-radius: var(--r2); padding: 4px 10px; cursor: pointer; transition: all 0.15s; }
.mh-salir:hover { color: var(--red); border-color: var(--red); }

/* ── BARRA DE DESPLAZAMIENTO ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* «Proveedor nuevo» / «Cliente nuevo»: el panel que se abre debajo de un
   campo cuando lo escrito no existe, con las parecidas para elegir. */
.prov-nuevo { display: none; }
.prov-nuevo.vis { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 12px; border: 1px dashed var(--border2); border-radius: var(--r2); }
.pn-tit { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; }
.pn-sug { display: flex; flex-direction: column; gap: 6px; }
.pn-sug:empty { display: none; }
.pn-q { font-size: 12.5px; color: var(--text3); }
.pn-op { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; text-align: left; background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r2); padding: 8px 10px; cursor: pointer; font-family: var(--font); color: var(--text); font-size: 13.5px; transition: border-color .12s; }
.pn-op:hover { border-color: var(--accent); }
.pn-op b { font-weight: 500; }
.pn-op span { font-size: 12px; color: var(--text3); }
.pn-op.fuerte { border-color: var(--orange); }
.pn-otro { align-self: flex-start; }
