:root {
  --verde: #13a06b;
  --verde-osc: #0c7a51;
  --azul: #2b8bd6;
  --azul-osc: #1d6fb0;
  --naranja: #f08a24;
  --morado: #7b61d1;
  --rojo: #e2483d;
  --tinta: #15181d;
  --gris: #6b7280;
  --linea: #e6e8ec;
  --fondo: #f4f6f8;
  --blanco: #fff;
  --radio: 16px;
  --sombra: 0 6px 22px rgba(20, 30, 50, .08);
  --degradado: linear-gradient(100deg, var(--verde) 0%, var(--azul) 100%);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tinta);
  background: var(--fondo);
  font-size: 16px;
  line-height: 1.4;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.oculto { display: none !important; }
.muted { color: var(--gris); }
.small { font-size: 13px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; font-weight: 650;
  background: var(--blanco); border: 1px solid var(--linea);
  transition: transform .08s ease, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.primario { background: var(--azul); color: #fff; border-color: transparent; }
.btn.verde { background: var(--verde); color: #fff; border-color: transparent; }
.btn.rojo { background: var(--rojo); color: #fff; border-color: transparent; }
.btn.degradado { background: var(--degradado); color: #fff; border-color: transparent; }
.btn.chico { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.bloque { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tarjeta { background: var(--blanco); border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: #eef1f4; font-size: 13px; font-weight: 600;
}
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--verde); display: inline-block; }
.punto.rojo { background: var(--rojo); }

input[type=text], input[type=password], input[type=number], input[type=time], textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--linea); border-radius: 12px; background: #fff; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(43, 139, 214, .15); }
label.campo { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }

/* Avisos */
#toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: #1f2937; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sombra); transition: opacity .4s, transform .4s; font-weight: 500; }
.toast.ok { background: var(--verde-osc); }
.toast.error { background: var(--rojo); }
.toast.fuera { opacity: 0; transform: translateY(10px); }

/* Ventanas emergentes (hoja inferior) */
.velo { position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: #fff; width: min(100%, 520px); border-radius: 22px 22px 0 0; padding: 20px 18px 26px; max-height: 88vh; overflow: auto; animation: sube .22s ease; }
@keyframes sube { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.hoja h3 { margin: 0 0 6px; font-size: 20px; }
.hoja .cerrar { float: right; font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--gris); }

.miniatura { width: 72px; height: 54px; border-radius: 10px; object-fit: cover; background: #dde3ea; flex: none; }
.vacio { text-align: center; color: var(--gris); padding: 26px 10px; }

/* Crédito del sistema */
.credito { text-align: center; font-size: 14px; color: #4b5563; margin: 26px 0 8px; line-height: 1.6; }
.credito a { color: #128c4a; font-weight: 700; text-decoration: none; white-space: nowrap; }
