/* =====================================================================
   Solisel POS · Estilos base compartidos (todas las páginas)
   Colores corporativos:
     Principal  #000C24  azul oscuro
     Secundario #42B9DC  azul claro
     Terciario  #C2AED2  morado
   ===================================================================== */
:root {
  /* Corporativos */
  --azul-oscuro: #000C24;
  --azul-claro:  #42B9DC;
  --morado:      #C2AED2;

  /* Superficies derivadas del azul oscuro */
  --bg:        #000C24;
  --bg-2:      #041330;
  --surface:   #0A1B3D;
  --surface-2: #11264F;
  --line:      rgba(194,174,210,.10);
  --line-2:    rgba(194,174,210,.20);

  /* Texto */
  --text:   #F2F5FA;
  --text-2: #A9B6CC;
  --text-3: #6C7C98;

  /* Acentos */
  --brand:      var(--azul-claro);
  --brand-2:    var(--morado);
  --brand-glow: rgba(66,185,220,.35);
  --sobre-brand: var(--azul-oscuro);          /* texto encima del degradado */
  --degradado:  linear-gradient(135deg, var(--azul-claro) 0%, var(--morado) 100%);

  /* Estados (solo para comunicar estado, no para decorar) */
  --ok:    #34D399;
  --warn:  #FBBF24;
  --error: #F87171;

  --r-sm: 12px;
  --r:    16px;
  --r-lg: 24px;
  --sombra: 0 20px 60px -20px rgba(0,0,0,.7);

  --f-display: 'Sora', system-ui, sans-serif;
  --f-body:    'DM Sans', system-ui, sans-serif;
  --fs-p: 15px;                                  /* párrafos (escritorio) */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--fs-p);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.interna {
  background:
    radial-gradient(60% 50% at 100% 0%, rgba(66,185,220,.12), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(194,174,210,.10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, h4 { font-family: var(--f-display); letter-spacing: -0.02em; margin: 0; }
p, li, label, input, select, textarea, button { font-size: var(--fs-p); }
button { font-family: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-2); }
.oculto { display: none !important; }
:focus-visible { outline: 2px solid var(--azul-claro); outline-offset: 2px; }

/* ---------- Marca (logo corporativo) ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { display: block; height: 34px; width: auto; }
.brand-tag {
  padding: 3px 9px; border-radius: 8px;
  background: var(--degradado); color: var(--sobre-brand);
  font: 800 12px var(--f-display); letter-spacing: .08em;
}

/* ---------- Barra superior (común) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 28px; min-height: 68px;
  background: rgba(0,12,36,.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-izq, .topbar-der { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar-izq { flex: 1; }
.topbar-der { flex: none; }
.topbar-der { gap: 20px; }
.topbar-titulo {
  padding-left: 16px; border-left: 1px solid var(--line-2);
  font: 700 18px var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.reloj { text-align: right; line-height: 1.2; }
.reloj b { display: block; font: 700 18px var(--f-display); font-variant-numeric: tabular-nums; }
.reloj small { display: block; color: var(--text-2); font-size: 13px; }
.reloj small::first-letter { text-transform: uppercase; }
.usuario { display: flex; align-items: center; gap: 10px; line-height: 1.2; }
.usuario b { display: block; font-size: 15px; }
.usuario small { color: var(--morado); font-size: 13px; font-weight: 600; }
.avatar {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border: 2px solid var(--c); color: var(--c);
  font: 700 15px var(--f-display);
}
.btn.btn-salir { height: 42px; padding: 0 14px; }
.btn-salir svg { width: 18px; height: 18px; }
.btn.btn-icono { width: 42px; height: 42px; padding: 0; flex: none; }
.btn-icono svg { width: 20px; height: 20px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface-2);
  color: var(--text); text-decoration: none;
  font-weight: 600; transition: transform .12s, background .2s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { flex: none; }
.btn-primario {
  border: 0; color: var(--sobre-brand);
  background: var(--degradado);
  box-shadow: 0 10px 30px -10px var(--brand-glow);
}
.btn-primario:hover { filter: brightness(1.06); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Campos ---------- */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.campo input {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.campo input:focus { border-color: var(--azul-claro); box-shadow: 0 0 0 4px rgba(66,185,220,.18); }

/* ---------- Pastillas de estado ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: rgba(194,174,210,.14); color: var(--morado);
}
.pill-ok   { background: rgba(52,211,153,.15);  color: var(--ok); }
.pill-warn { background: rgba(251,191,36,.15);  color: var(--warn); }
.pill-err  { background: rgba(248,113,113,.15); color: var(--error); }
.pill-info { background: rgba(66,185,220,.15);  color: var(--azul-claro); }

.btn-peligro { border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.14); color: var(--error); }
.btn-peligro:hover { background: rgba(248,113,113,.22); }

/* ---------- Diálogo de confirmación ---------- */
.dialogo-capa {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px;
  background: rgba(0,6,20,.7); backdrop-filter: blur(4px); animation: aparecer-capa .18s ease;
}
.dialogo-capa.saliendo { opacity: 0; transition: opacity .18s; }
.dialogo {
  width: 100%; max-width: 400px; padding: 24px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--sombra);
  animation: aparecer-dialogo .22s cubic-bezier(.2,.8,.2,1);
}
.dialogo h3 { font-size: 20px; margin-bottom: 6px; }
.dialogo p { margin: 0 0 6px; }
.dialogo .campo { margin: 14px 0 0; }
.dialogo-botones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes aparecer-capa { from { opacity: 0; } }
@keyframes aparecer-dialogo { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------- Notificaciones (toast) ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; left: auto; display: grid; gap: 10px; z-index: 999; }
.toast {
  min-width: 240px; max-width: 360px; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-2); border-left: 4px solid var(--azul-claro);
  box-shadow: var(--sombra); animation: toast-in .3s ease;
}
.toast.error { border-left-color: var(--error); }
.toast.ok    { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Móvil: párrafos a 17px para máxima legibilidad ---------- */
@media (max-width: 900px) { .reloj { display: none; } }

@media (max-width: 768px) {
  :root { --fs-p: 17px; }
  .campo > span { font-size: 15px; }
  .pill { font-size: 14px; }
  .toasts { left: 16px; }
  .toast { max-width: none; }

  .topbar { padding: 10px 14px; min-height: 60px; gap: 10px; }
  .topbar-izq { gap: 10px; }
  .topbar .brand-logo { height: 22px; }
  .topbar .brand-tag { display: none; }
  .topbar-titulo { padding-left: 10px; font-size: 16px; }
  .usuario div, .btn-salir span, .reloj { display: none; }
  .btn.btn-salir { width: 42px; padding: 0; }
}

@media (max-width: 480px) {
  .topbar .usuario { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
