:root {
  --rojo: #c62828;
  --rojo-oscuro: #8e0000;
  --fondo: #f5f5f5;
  --borde: #ddd;
  --texto: #212121;
  --naranja: #e65100;
  --verde: #2e7d32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  padding-bottom: 64px;
}

#topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rojo);
  color: white;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 10;
}
#topbar-title { font-size: 1.1rem; font-weight: 600; flex: 1; }
.icon-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
}

#app { padding: 12px; max-width: 640px; margin: 0 auto; }

#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: white;
  border-top: 1px solid var(--borde);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 12px 0;
  font-size: 0.95rem;
  color: #666;
}
.nav-btn.active { color: var(--rojo); font-weight: 600; }

.hidden { display: none !important; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
}
input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--borde);
  border-radius: 6px;
  margin-bottom: 10px;
  background: white;
}
label { font-size: 0.85rem; color: #555; display: block; margin-bottom: 4px; }
.field { margin-bottom: 12px; }

button.btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--rojo);
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}
button.btn:disabled { background: #bbb; cursor: not-allowed; }
button.btn.secundario { background: #eee; color: var(--texto); }
button.btn.chico { width: auto; padding: 8px 14px; font-weight: 500; margin: 0; }

.card {
  background: white;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.card-titulo { font-weight: 600; margin-bottom: 2px; }
.card-sub { font-size: 0.85rem; color: #666; }
.card-fila { display: flex; align-items: center; gap: 10px; }
.card-fila .info { flex: 1; }

.badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; }
.badge-pendiente { background: #fff3e0; color: var(--naranja); }
.badge-error { background: #ffebee; color: var(--rojo); }
.badge-ok { background: #e8f5e9; color: var(--verde); }

.error-msg { color: var(--rojo); margin-bottom: 10px; }
.aviso { background: #fff3e0; color: #8a5300; padding: 10px; border-radius: 6px; margin-bottom: 12px; }

.fab {
  position: fixed;
  right: 20px;
  bottom: 76px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rojo);
  color: white;
  border: none;
  font-size: 1.6rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
}

.search-box { margin-bottom: 12px; }

.centro { text-align: center; color: #888; padding: 24px 0; }

.signature-canvas {
  width: 100%;
  height: 240px;
  border: 1px solid var(--borde);
  border-radius: 6px;
  background: white;
  touch-action: none;
}

.top-actions { display: flex; justify-content: flex-end; margin-bottom: 8px; }

.baraki-tab.active-tab { background: var(--rojo); color: white; }
.acciones-check { background: white; border: 1px solid var(--borde); border-radius: 6px; padding: 10px; margin-bottom: 6px; }
