:root {
  --rojo: #c0392b;
  --rojo-oscuro: #922b21;
  --gris-fondo: #f4f4f4;
  --gris-borde: #ddd;
  --verde: #27ae60;
  --texto: #222;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: var(--gris-fondo);
  color: var(--texto);
}

header.barra {
  background: var(--rojo);
  color: white;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

header.barra a { color: white; text-decoration: none; }
header.barra .marca { font-weight: bold; font-size: 1.2em; }
header.barra nav a { margin-left: 16px; opacity: 0.9; }
header.barra nav a:hover { opacity: 1; text-decoration: underline; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.tarjeta {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h1, h2, h3 { margin-top: 0; }

.login-caja {
  max-width: 360px;
  margin: 80px auto;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9em; }

input[type=text], input[type=password], input[type=date], input[type=number], select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gris-borde);
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 1em;
}

button, .boton {
  background: var(--rojo);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .boton:hover { background: var(--rojo-oscuro); }
button.secundario, .boton.secundario { background: #7f8c8d; }
button.verde, .boton.verde { background: var(--verde); }

.error { color: var(--rojo); margin-bottom: 12px; }
.ok { color: var(--verde); margin-bottom: 12px; }

.categoria-titulo {
  background: #2c3e50;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  margin: 24px 0 8px;
}
.subcategoria-titulo {
  font-weight: 600;
  color: #555;
  margin: 14px 0 6px;
  padding-left: 4px;
  border-left: 3px solid var(--rojo);
  padding-left: 8px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--gris-borde); }
th { background: #fafafa; font-size: 0.85em; text-transform: uppercase; color: #777; }

.fila-producto { display: grid; grid-template-columns: 1fr 90px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eee; }
.fila-producto .cantidad-input { margin-bottom: 0; }
.fila-producto .nombre-prod { font-size: 0.98em; }
.fila-producto .unidad { color: #888; font-size: 0.85em; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.78em; font-weight: 600; }
.badge.enviado { background: #fdebd0; color: #a04000; }
.badge.confirmado { background: #d5f5e3; color: #196f3d; }
.badge.anulado { background: #eaeaea; color: #666; }

.lista-pedidos a { text-decoration: none; color: inherit; }
.item-pedido-lista { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-bottom: 1px solid var(--gris-borde); }
.item-pedido-lista:hover { background: #fafafa; }

.acciones-flotantes {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 14px 20px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  border-radius: 8px 8px 0 0;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media print {
  header.barra, .no-imprimir { display: none !important; }
  body { background: white; }
  main { max-width: 100%; padding: 0; }
  .tarjeta { box-shadow: none; }
}
