:root {
  --naranja: #e0803c;
  --amarillo: #f4b143;
  --oliva: #5e6b4e;
  --oscuro: #2f352c;
  --fondo: #f7f6f2;
  --tarjeta: #ffffff;
  --borde: #e3e1d9;
  --texto: #2f352c;
  --suave: #6f7568;
  --ok: #4f7a3a;
  --error: #b3412e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fondo); color: var(--texto); font-size: 15px; }
a { color: var(--oliva); }
header { background: var(--tarjeta); border-bottom: 1px solid var(--borde); padding: 10px 24px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
header img { height: 34px; }
header nav { display: flex; gap: 18px; flex: 1; }
header nav a { text-decoration: none; color: var(--texto); font-weight: 500; }
header nav a:hover { color: var(--naranja); }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.card { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 10px; padding: 18px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--suave); font-size: 13px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--borde); border-radius: 7px; font: inherit; background: #fff; }
textarea { min-height: 220px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1; min-width: 180px; }
button, .btn { background: var(--naranja); color: #fff; border: 0; border-radius: 7px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { filter: brightness(0.95); }
.btn-sec { background: #fff; color: var(--texto); border: 1px solid var(--borde); }
.btn-peligro { background: var(--error); }
.btn-peq { padding: 6px 10px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; font-size: 14px; }
th { background: #efede6; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--suave); }
tr:last-child td { border-bottom: 0; }
.tabla-scroll { overflow-x: auto; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #efede6; color: var(--suave); }
.chip.nueva { background: #fdf0e3; color: #a65a22; }
.chip.contactada { background: #e8efe2; color: var(--ok); }
.chip.respondio { background: #dcebd3; color: #2f5d1e; }
.chip.baja, .chip.descartada { background: #f6e1dc; color: var(--error); }
.chip.terminada, .chip.enviado { background: #e8efe2; color: var(--ok); }
.chip.error { background: #f6e1dc; color: var(--error); }
.muted { color: var(--suave); }
.aviso { background: #fdf3e2; border: 1px solid #f0d5a8; border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.ok { background: #e8efe2; border-color: #c8d9bb; }
.ficha h3 { margin: 0 0 6px; font-size: 16px; }
.ficha p { margin: 4px 0; font-size: 14px; word-break: break-word; }
.ficha .pie { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.barra { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.barra form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.barra input[type=search] { width: 220px; }
.vista a { padding: 7px 12px; border: 1px solid var(--borde); background: #fff; text-decoration: none; color: var(--texto); font-size: 14px; }
.vista a.activa { background: var(--oliva); color: #fff; border-color: var(--oliva); }
.vista a:first-child { border-radius: 7px 0 0 7px; }
.vista a:last-child { border-radius: 0 7px 7px 0; }
pre.preview { white-space: pre-wrap; background: #fbfaf7; border: 1px solid var(--borde); border-radius: 8px; padding: 14px; font-family: inherit; font-size: 14px; }
.login { max-width: 360px; margin: 10vh auto; }
.login img { width: 200px; display: block; margin: 0 auto 20px; }
@media (max-width: 640px) { header { padding: 10px 16px; } header nav { gap: 12px; font-size: 14px; } .barra input[type=search] { width: 100%; } }
th a.orden { color: inherit; text-decoration: none; }
th a.orden:hover { color: var(--naranja); }
.redactar { margin-top: 18px; border-color: var(--naranja); }
.barra-envio { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--oscuro); color: #fff;
  border-radius: 12px; padding: 10px 12px 10px 18px; display: flex; gap: 16px; align-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 10; }
.barra-envio[hidden], .redactar[hidden] { display: none; }
